[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 07:26:20 CDT 2017


Dear Johan,


I would look at the hemi example.


There it shows how to interpolate a list of values

(interp_v is a routine inside hemi.usr).


Once you have a list, you can write it out yourself

(again, as shown in hemi.usr).


Make certain that your interrogation list is _not_ repeated

on every processor. (Otherwise you end up doing P times

more work.)


hth,

Paul


________________________________
From: Nek5000-users <nek5000-users-bounces at lists.mcs.anl.gov> on behalf of nek5000-users at lists.mcs.anl.gov <nek5000-users at lists.mcs.anl.gov>
Sent: Monday, October 16, 2017 4:04:02 AM
To: nek5000-users at lists.mcs.anl.gov
Subject: [Nek5000-users] Calling subroutine "hpts" for several files


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/ff649135/attachment.html>


More information about the Nek5000-users mailing list