Why fcntl start=0, len=0, whence=2 works? - locking

According to the fcntl manual, fcntl locking with start=0, len=0, whence=2 should lock the byte range starting from the end of file (whence=2), with offset 0 (start=0) until the end of file (len=0), which in my mind means locking in total 0 bytes from EOF to EOF.
In this case I would expect that locking with those arguments would not lock anything. However, if I try (using python wrapper fcntl), the following code does lock something, and the second copy is waiting for the first to finish:
f = open('some_file', 'a+')
fcntl.lockf(f, fcntl.LOCK_EX, 0, 0, 2)
print('got the lock')
time.sleep(100)
Similarly, the code with parameters whence=2, offset=100, len=0 also works, even those in this case the byte range is backwards [EOF + 100, EOF].
What am I locking?

I did some tests, and the answer seems to be as follows - whence=2 does not lock until the EOF, but until the infinity, which is not how I would read the description in the man page:
Specifying 0 for l_len has the
special meaning: lock all bytes starting at the location
specified by l_whence and l_start through to the end of file, no
matter how large the file grows.
😞

Related

Optimising applescript to decrease energy impact

I have this script that I created for a battery indicator widget that will show on my (Macbook pro) touch bar and have it set to re-run every 3 secs (to update the text and logo), but it is eating a lot of energy just running in the background and I was wondering if maybe there was a way to make it more efficient in some way in order to decrease battery consumption.
Here is the script:
(Keep in mind that the images for the icon are in base64 because I plan on sharing this widget with people who might know nothing about computers and therefor I can't have them download and save an image in a specific directory etc..)
set bat_empty_icon to "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA3XAAAN1wFCKJt4AAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAALzUlEQVR4Ae3dv69lVRUH8IdMDAxQTYjAWFAQEwsrAWNCYkFoJsgQO7UxYvQPoFWgMDYWxEYrbfzVAoUNgcRkEg2MFcWEhIIYYGhomOFXjOD6jjnkcmfemzez7ptz9r2fnay59915+9y1P/vsNeec+2P29jQCBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQINAXuKm/iUtbuLX+fLjioYqTFfes3N5R9zUCowpcqMTfqXh75fZM3X+p4qOKoVunAJyokZ+ueKzikYrjFRqBXRH4sAb6YsULFc9XvFexE+22GuVTFamMnwkG9oFLayFrImtja9vNNbKfVpyvsPAZ2Acu3weyNrJGslaGaIc9Bcg5/XMVDwwxKkkSmFfg1Xr6xyty7WDR7TAF4MEaQRb/3YseieQILEsgRwMpAq8sK60vZvOlL/542U8/rEf+XmHxX0bjAQIHCmTNZO1kDS22HXSuksT/VHFssdlLjMCyBbJ2vlfxRsVrS0x1v1OAHPanet2yxKTlRGAwgY8r3+9ULO504EoFIBf8zlY47C8EjcCGBHJN4P6KRV0YXL8GkFMCF/w2NOM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chargeState to do shell script "pmset -g batt | awk '{printf \"%s %s\\n\", $4,$5;exit}'"
set percentLeft to do shell script "pmset -g batt | egrep -ow '([0-9]{1,3})[%]'" as text
set percentcheck to (item 1 of words of percentLeft as integer)
on new_icon(base64Code)
set percentLeft to do shell script "pmset -g batt | egrep -ow '([0-9]{1,3})[%]'" as text
tell application "BetterTouchTool"
update_touch_bar_widget "482F2657-A978-4D25-B9D6-EABFAD7E3B0A" text percentLeft icon_data base64Code
end tell
end new_icon
if (chargeState contains "AC") then
my new_icon(bat_charging_icon)
else if percentcheck ≥ 85 then
my new_icon(bat_full_icon)
else if (percentcheck < 85) and (percentcheck ≥ 65) then
my new_icon(bat_three_quarters_icon)
else if (percentcheck < 65) and (percentcheck ≥ 31) then
my new_icon(bat_three_quarters_icon)
else if percentcheck < 31 then
my new_icon(bat_low_icon)
else if percentcheck ≤ 10 then
my new_icon(bat_empty_icon)
end if
Your first step should be to increase the intervals at which you run the script. There is no need to have it run every 3 seconds (!). Even once a minute would be sufficient but I, personally, would set it to something such as once every ten minutes, since the battery level doesn't tends to only change once within a ten minute window. Even if it changed twice (e.g. dropping from 97% to 96% then to 95%), there would be no negative consequences from your script registering the level going from 97% straight down to 95% in a ten minute interval.
The next thing you can do is store those base 64 strings in properties rather than variables. Properties are set once and stored between subsequent runs of a script. If the values of the properties aren't altered, then the script doesn't need to read a new set of values each time it executes. As they are set at compile time, the overhead is reduced at run time.
The next thing you can do is get rid of the do shell script commands. They incur a lot of overhead. Instead, you can use AppleScriptObjC calls to obtain the information you need. There is still a slight overhead in implementing AppleScriptObjC compared to vanilla AppleScript, but it won't be as great as the cost of creating multiple shell processes:
property bat_empty_icon : "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA3XAAAN1wFCKJt4AAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAALzUlEQVR4Ae3dv69lVRUH8IdMDAxQTYjAWFAQEwsrAWNCYkFoJsgQO7UxYvQPoFWgMDYWxEYrbfzVAoUNgcRkEg2MFcWEhIIYYGhomOFXjOD6jjnkcmfemzez7ptz9r2fnay59915+9y1P/vsNeec+2P29jQCBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQINAXuKm/iUtbuLX+fLjioYqTFfes3N5R9zUCowpcqMTfqXh75fZM3X+p4qOKoVunAJyokZ+ueKzikYrjFRqBXRH4sAb6YsULFc9XvFexE+22GuVTFamMnwkG9oFLayFrImtja9vNNbKfVpyvsPAZ2Acu3weyNrJG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OAOQDMAuYAMAuYA8AsYA4As4A5AMwC5gAwC5gDwCxgDgCzgDkAzALmADALmAPALGAOALOAOQDMAuYAMAuYA8AsYA4As4A5AMwC5gAwC5gDwCxgDgCzgDkAzALmADALmAPALGAOALOAOQDMAuYAMAuYA8AsYA4As4A5AMwC5gAwC5gDwCxgDgCzgDkAzALmADALmAPALGAOALOA/R+GatypVlYrzAAAAABJRU5ErkJggg=="
global percentage
set [percentage, powersource] to [|current capacity|, ¬
|power source state|] of battery's info()
if powersource contains "AC" then
new_icon(bat_charging_icon)
else if percentage ≥ 85 then
new_icon(bat_full_icon)
else if percentage ≥ 65 then
new_icon(bat_three_quarters_icon)
else if percentage ≥ 31 then
new_icon(bat_three_quarters_icon)
else if percentage ≥ 11 then
new_icon(bat_low_icon)
else
new_icon(bat_empty_icon)
end if
on new_icon(base64Code)
global percentage
tell application "BetterTouchTool"
update_touch_bar_widget ¬
"482F2657-A978-4D25-B9D6-EABFAD7E3B0A" text ¬
"" & percentage & "%" icon_data base64Code
end tell
end new_icon
script battery
use framework "IOKit"
on info()
current application's IOPSCopyPowerSourcesInfo() as record
end info
end script
Additionally, I tidied up the if...then...else block so it doesn't do more number comparisons than necessary.

Ghostscript for PS integrity test: terminate at EOF, return error unless stack is empty

To test the integrity of PostScript files, I'd like to run Ghostscript in the following way:
Return 1 (or other error code) on error
Return 0 (success) at EOF if stack is empty
Return 1 (or other error code) otherwise
I could run gs in the background, and use a timeout to force termination if gs hangs with items left on the stack. Is there an easier solution?
Ghostscript won't hang if you send files as input (unless you write a program which enters an infinite loop or otherwise fails to reach a halting state). Having items on any of the stacks won't cause it to hang.
On the other hand, it won't give you an error if a PostScript program leaves operands on the operand stack (or dictionaries on the dictionary stack, clips on the clip stack or gstates on the graphics state stack). This is because that's not an error, and since PostScript interpreters normally run in a job server loop its not a problem either. Terminating the job returns control to the job server loop which does a save and restore round the total job, thereby clearing up anything left behind.
I'd suggest that if you really want to do this you need to adopt the same approach, you need to write a PostScript program which executes the PostScript program you want to 'test', then checks the operand stack (and other stacks if required) to see if anything is left. Note that you will want to execute the test program in a stopped context, as an error in the course of the program will clearly potentially leave stuff lying around.
Ghostscript returns 0 on a clean exit and a value less than 0 for errors, if I remember correctly. You would need to use signalerror in your test framework in order to raise an error if items are left at the end of a program.
[EDIT]
Anything supplied to Ghostscript on the command line by either -s or -d is defined in systemdict, so if we do -sInputFileName=/test.pdf then we will find in systemdict a key /InputFileName whose value is a string with the contents (/test.pdf). We can use that to pass the filename to our program.
The stopped operator takes an executable array as an argument, and returns either true or false depending on whether an error occurred while executing the array (3rd Edition PLRM, p 697).
So we need to run the program contained in the filename we've been given, and do it in a 'stopped' context. Something like this:
{InputFileName run} stopped
{
(Error occurred\n) print flush
%% Potentially check $error for more information.
}{
(program terminated normally\n) print flush
%% Here you could check the various stacks
} ifelse
The following, based 90% on KenS's answer, is 99% satisfactory:
Program checkIntegrity.ps:
{Script run} stopped
{
(\n===> Integrity test failed: ) print Script print ( has error\n\n) print
handleerror
(ignore this error which only serves to force a return value of 1) /syntaxerror signalerror
}{
% script passed, now check the stack
count dup 0 eq {
pop (\n===> Integrity test passed: ) print Script print ( terminated normally\n\n) print
} {
(\n===> Integrity test failed: ) print Script print ( left ) print
3 string cvs print ( item(s) on stack\n\n) print
Script /syntaxerror signalerror
} ifelse
} ifelse
quit
Execute with
gs -q -sScript=CodeToBeChecked.ps checkIntegrity.ps ; echo $?
For the last 1% of satisfaction I would need a replacement for
(blabla) /syntaxerror signalerror
It forces exit with return code 1, but is very verbous and distracts from the actual error in the checked script that is reported by handleerror. Therefore a cleaner way to exit(1) would be welcome.

while [[ condition ]] stalls on loop exit

I have a problem with ksh in that a while loop is failing to obey the "while" condition. I should add now that this is ksh88 on my client's Solaris box. (That's a separate problem that can't be addressed in this forum. ;) I have seen Lance's question and some similar but none that I have found seem to address this. (Disclaimer: NO I haven't looked at every ksh question in this forum)
Here's a very cut down piece of code that replicates the problem:
1 #!/usr/bin/ksh
2 #
3 go=1
4 set -x
5 tail -0f loop-test.txt | while [[ $go -eq 1 ]]
6 do
7 read lbuff
8 set $lbuff
9 nwords=$#
10 printf "Line has %d words <%s>\n" $nwords "${lbuff}"
11 if [[ "${lbuff}" = "0" ]]
12 then
13 printf "Line consists of %s; time to absquatulate\n" $lbuff
14 go=0 # Violate the WHILE condition to get out of loop
15 fi
16 done
17 printf "\nLooks like I've fallen out of the loop\n"
18 exit 0
The way I test this is:
Run loop-test.sh in background mode
In a different window I run commands like "echo some nonsense >>loop_test.txt" (w/o the quotes, of course)
When I wish to exit, I type "echo 0 >>loop-test.txt"
What happens? It indeed sets go=0 and displays the line:
Line consists of 0; time to absquatulate
but does not exit the loop. To break out I append one more line to the txt file. The loop does NOT process that line and just falls out of the loop, issuing that "fallen out" message before exiting.
What's going on with this? I don't want to use "break" because in the actual script, the loop is monitoring the log of a database engine and the flag is set when it sees messages that the engine is shutting down. The actual script must still process those final lines before exiting.
Open to ideas, anyone?
Thanks much!
-- J.
OK, that flopped pretty quick. After reading a few other posts, I found an answer given by dogbane that sidesteps my entire pipe-to-while scheme. His is the second answer to a question (from 2013) where I see neeraj is using the same scheme I'm using.
What was wrong? The pipe-to-while has always worked for input that will end, like a file or a command with a distinct end to its output. However, from a tail command, there is no distinct EOF. Hence, the while-in-a-subshell doesn't know when to terminate.
Dogbane's solution: Don't use a pipe. Applying his logic to my situation, the basic loop is:
while read line
do
# put loop body here
done < <(tail -0f ${logfile})
No subshell, no problem.
Caveat about that syntax: There must be a space between the two < operators; otherwise it looks like a HEREIS document with bad syntax.
Er, one more catch: The syntax did not work in ksh, not even in the mksh (under cygwin) which emulates ksh93. But it did work in bash. So my boss is gonna have a good laugh at me, 'cause he knows I dislike bash.
So thanks MUCH, dogbane.
-- J
After articulating the problem and sleeping on it, the reason for the described behavior came to me: After setting go=0, the control flow of the loop still depends on another line of data coming in from STDIN via that pipe.
And now that I have realized the cause of the weirdness, I can speculate on an alternative way of reading from the stream. For the moment I am thinking of the following solution:
Open the input file as STDIN (Need to research the exec syntax for that)
When the condition occurs, close STDIN (Again, need to research the syntax for that)
It should then be safe to use the more intuitive:while read lbuffat the top of the loop.
I'll test this out today and post the result. I'd hope someone else benefit from the method (if it works).

Fortran program sometimes hangs while writing large files to disk

I have written a meshing application that runs quite well except for one thing:
While writing the results to disk, the program sometimes hangs. Well effectively it is still running, I can see it produces 100% CPU load and occupying memory using top. But there is no new data written to the file and this state would probably last indefinitely.
The job can not even be killed, the only option I had so far was rebooting the machine to get rid of the job.
However, most of the time the exact same job executes until the end without any problems. It should be noted that this only happens for large jobs where the final file size is somewhere above the order of 50GB. I haven't hat this behavior with smaller jobs so far. The result file is written up to a different point each time. Sometimes its 45GB, sometimes its 60GB or something completely different.
The workstation I use operates OpenSuse 13.1, has enough RAM and Disk space available. Yet the same behavior could be observed on different machines.
What I tried so far (apart from the usual debugging) was using Gfortran and Intel Fortran compilers to no avail. I messed around with the -mcmodel=large compiler option, but as I understood this is not related to the size of files written by the program and did not help anything.
I don't know what information to provide since I am really running out of ideas what could be causing the problem. I append the routine that writes an ASCII result file here because it produces the largest file size, but I have the same issues when writing unformatted files with a similar routine.
ANY hint on what could possibly cause this behavior is highly appreciated.
SUBROUTINE write_legacymesh
use types
use parameters
use data
implicit none
INTEGER :: l, n, i, j, k, number, c, neighbor
REAL(DP), DIMENSION(3) :: pos_d
CHARACTER(LEN=100) :: dummy_char
INTEGER(I4B), DIMENSION(26) :: neighborbuffer
LOGICAL :: file_exists
call write_header
call system ('sync')
! create the mesh file
dummy_char = folder_mesh // '/' // file_mesh
write(*,'(A,A)') ' writing mesh: ', trim(adjustl(dummy_char))
open(unit=20, file=trim(adjustl(dummy_char)), status='replace', action='write')
! write the mesh file
write(20,'(A)') ' LB database'
l = level_max
! write the header for this mesh size
write(20,'(A)') ' number of collision centers'
write(20,'(I16)') nf(l)
write(20,'(A)') ' number of cut links'
write(20,'(I16)') ncut(l)
write(20,'(A)') ' number of boundary collision centers'
write(20,'(I16)') nb(l)
write(20,'(A)') ' dummy value'
write(20,'(I16)') 0
write(20,'(A)') ' number of inflow boundary collision centers'
write(20,'(I16)') nb1(l)
write(20,'(A)') ' number of pressure boundary collision centers'
write(20,'(I16)') nb2(l)
write(20,'(A)') ' number of slip boundary collision centers'
write(20,'(I16)') nb3(l)
write(20,'(A)') ' number of noslip boundary collision centers'
write(20,'(I16)') nb4(l)
write(20,'(A)') ' lattice spacing'
write(20,'(E16.8)') dx(l)*scaling
! write the coordinates
write(20,'(A)') ' cc RBT value cc coordinates'
do n=1, nf(l)
number = order_level(l)%order(n)
i = levels(l)%blocks(number)%pos(1)
j = levels(l)%blocks(number)%pos(2)
k = levels(l)%blocks(number)%pos(3)
! rescale and move the geometry to get the original size and position
pos_d(1) = (real(i,kind=dp) - 0.5_dp) * dx(l) + corner_ibc(1)
pos_d(2) = (real(j,kind=dp) - 0.5_dp) * dx(l) + corner_ibc(2)
pos_d(3) = (real(k,kind=dp) - 0.5_dp) * dx(l) + corner_ibc(3)
write(20,'(2I16,3E20.7)') n, levels(l)%blocks(number)%state, pos_d*scaling
end do
! write the link info
write(20,'(A)') ' link information'
do n=1, nf(l)
number = order_level(l)%order(n)
do c=1, nlinks
neighbor = levels(l)%blocks(number)%neighbors(c)
if(neighbor .GT. 0) then
neighborbuffer(c) = levels(l)%blocks(neighbor)%number
else
neighborbuffer(c) = neighbor
end if
end do
write(20,'(7I16)') n, neighborbuffer(1:6)
write(20,'(A,6I16)') ' ', neighborbuffer(7:12)
write(20,'(A,6I16)') ' ', neighborbuffer(13:18)
end do
! write the q-values
write(20,'(A)') ' q-values'
do n=1, ncut(l)
write(20,'(I16,E20.7)') n, max(qmin, min(qmax, aux_level(l)%q_values(n)))
end do
write(20,'(A)') ' end of data'
close(unit=20)
END SUBROUTINE write_legacymesh
Edit1: Following the suggestions of flushing write buffers, I added this to every loop that writes data:
if(mod(n,10000000) .EQ. 0) then
call flush(20)
close(unit=20)
call system('sync')
open(unit=20, file=trim(adjustl(dummy_char)), status='old', position='append', action='write')
end if
This did not change anything, the routine still hangs at a random point, this time after writing 18.5GB of data or 211'149'016 write events in the first loop.
Edit2: Deactivating buffered I/O with the Intel Fortran compiler (not using the -assume buffered_io flag) kind of "solved" the issue. But of course this leaves me with slow unbuffered writes for large files, a particularly unpleasant combination.
Edit3: Thanks for the suggestion to add manual write buffers. The file format is not well suited to make use of them efficiently, but its still better than nothing. Anyway, this is a legacy file format and I am positive that I can convince my co-workers that a different file format or even unformatted files are the better option.
While I still have no idea what causes the error, at least I have a tolerable way to avoid it now. Thanks for all the valuable suggestions.

valgrind give error when printing the second line to file

I'm using valgrind to find faults in my code. The command I use is
valgrind --leak-check=yes ./a.out
and I compile the code with -g code alone. I get many errors pointing to a single write line (The three printed values are initialized and well defined).
write (22,*) avlength, stdlength, avenergy
All with the Conditional jump or move depends on uninitialised value(s) error. The said line is the second line from a bunch of lines printing to a single file. At the end of the errors, I get two more, one pointing to the line opening the file
resStep = int(conf*100/iterate)
if (resStep.lt.10) then
write (resFile, "(A5,I1)") "res00",resStep
elseif (ResStep.lt.100) then
write (resFile, "(A4,I2)") "res0",resStep
else
write (resFile, "(A3,I1)") "res",resStep
endif
open (unit=22,file=trim(resFile),status='replace',
c action='write')
resStep is integer. The error is Syscall param write(buf) points to uninitialised byte(s). Finally, I get an error Address 0x52d83f4 is 212 bytes inside a block of size 8,344 alloc'd when I flush the file (before closing it).
I can't find any logic here. If the problem is with opening the file in a faulty way, wouldn't I get the error at the first line?
I use f95 to compile this and my gcc version is 4.1.2. I can't upgrade any of it.
Wild guess: check the data type of resFile. Is it a string or a unit number?
My Fortran 95 is beyond rusty but try moving the call to open() before the calls to write() and pass an integer resUnit instead of resFile as the first argument to write():
CHARACTER(LEN=20):: resFile
INTEGER(KIND=2) :: resUnit, resStep
resStep = 1
resFile = 'MY-results'
resUnit = 22
open (unit=resUnit, file=trim(resFile), status='replace', action='write')
write(resUnit, "(A5,I1)") "res00", resStep
END