<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Dear Johan,</p>
<p><br>
</p>
<p>I would look at the hemi example.</p>
<p><br>
</p>
<p>There it shows how to interpolate a list of values</p>
<p>(interp_v is a routine inside hemi.usr).</p>
<p><br>
</p>
<p>Once you have a list, you can write it out yourself</p>
<p>(again, as shown in hemi.usr).</p>
<p><br>
</p>
<p>Make certain that your interrogation list is _not_ repeated</p>
<p>on every processor. (Otherwise you end up doing P times</p>
<p>more work.)</p>
<p><br>
</p>
<p>hth,</p>
<p>Paul</p>
<p><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nek5000-users <nek5000-users-bounces@lists.mcs.anl.gov> on behalf of nek5000-users@lists.mcs.anl.gov <nek5000-users@lists.mcs.anl.gov><br>
<b>Sent:</b> Monday, October 16, 2017 4:04:02 AM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Calling subroutine "hpts" for several files</font>
<div> </div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<p>Dear Neks,</p>
<p><br>
</p>
<p>I am post processing my data using the subroutine "hpts" to extract field values at specific points.</p>
<p>I want to loop over many files and extract the field values for each file.</p>
<p>Therefore I want to rename the file "hpts.out" that is created everytime I call hpts.<br>
</p>
<p>This code snippet is in userchk, and is looks like this:<br>
</p>
<div>
<div> <br>
</div>
<div> do i=1,100<br>
<br>
write(fname,'(I0.5)') i<br>
fname='cav0.f'//trim(fname)<br>
<br>
call load_fld(fname)<br>
<br>
call hpts<br>
<br>
call nekgsync<br>
if(nid==0)then<br>
call rename('hpts.out',trim(fname)//'_hpts')<br>
endif<br>
call nekgsync<br>
<br>
enddo</div>
<div><br>
</div>
<div>My basename is "cav", so fname is "cav0.f00XXX" for XXX = 1, ..., 100.</div>
<div>The code is intended to rename hpts.out for a file <span>"cav0.f00XXX</span>" into<span> "cav0.f00XXX</span>_hpts".</div>
<div><br>
</div>
<div>However, this does not work.</div>
<div>I get only one file; "cav0.f00001_hpts".</div>
<div>When I open this file it contains the data from "cav0.f000100 - the last file that was opened in the loop!</div>
<div><br>
</div>
<div>This makes me wonder if hpts.out is properly closed after beeing written to?<br>
</div>
<div>And also, how can I change my code to make it work as I indended?</div>
<div><br>
</div>
<div>Best,</div>
<div><br>
</div>
<div>Johan<br>
</div>
<div><br>
<br>
</div>
<br>
</div>
<br>
<p></p>
</div>
</div>
</body>
</html>