[Nek5000-users] Calling subroutine "hpts" for several files
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Mon Oct 16 04:04:02 CDT 2017
Dear Neks,
I am post processing my data using the subroutine "hpts" to extract field values at specific points.
I want to loop over many files and extract the field values for each file.
Therefore I want to rename the file "hpts.out" that is created everytime I call hpts.
This code snippet is in userchk, and is looks like this:
do i=1,100
write(fname,'(I0.5)') i
fname='cav0.f'//trim(fname)
call load_fld(fname)
call hpts
call nekgsync
if(nid==0)then
call rename('hpts.out',trim(fname)//'_hpts')
endif
call nekgsync
enddo
My basename is "cav", so fname is "cav0.f00XXX" for XXX = 1, ..., 100.
The code is intended to rename hpts.out for a file "cav0.f00XXX" into "cav0.f00XXX_hpts".
However, this does not work.
I get only one file; "cav0.f00001_hpts".
When I open this file it contains the data from "cav0.f000100 - the last file that was opened in the loop!
This makes me wonder if hpts.out is properly closed after beeing written to?
And also, how can I change my code to make it work as I indended?
Best,
Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20171016/44a39f0a/attachment.html>
More information about the Nek5000-users
mailing list