<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,Arial,Helvetica,sans-serif;" dir="ltr">
<p>And if I just want to interpolate one field, can I then pass this field directly into intpts?</p>
<p>Or does intpts change the content of the input array?<br>
<br>
For instance, the i:th passive scalar, like this:<br>
<br>
call intpts(t(:,:,:,:,i+1),1,pts,n,out,.true.,.true.,ihandle)<br>
<br>
?<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> Tuesday, October 17, 2017 12:27:47 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> Re: [Nek5000-users] Calling subroutine "hpts" for several files</font>
<div> </div>
</div>
<div><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>Hi Johan,</p>
<p><br>
</p>
<p>Yes -- you can have just one list on node 0 if you wish.</p>
<p><br>
</p>
<p>Make certain that the list length n=0 on on all other nodes (e.g.,</p>
<p><br>
</p>
<p> if (nid.gt.0) n=0</p>
<p> call the routine (..... , n)</p>
<p><br>
</p>
<p>The only reason to distribute the list is if it large and you don't</p>
<p>want to store it all on node 0.</p>
<p><br>
</p>
<p>The interpolation routine handles all data movement, as it should.</p>
<p><br>
</p>
<p>Best,</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> Tuesday, October 17, 2017 3:35:58 AM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> Re: [Nek5000-users] Calling subroutine "hpts" for several files</font>
<div> </div>
</div>
<div><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,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Thanks. After running the hemi example and looking into hemi.usr, I have some questions about how the interpolation works in parallell.</p>
<p>It seems as the interpolation is done by a call to the subroutine "intpts" in from the subroutine "interp_v":</p>
<p><br>
</p>
<p>"call intpts(wrk,3,pts,n,uvw,.true.,.true.,ihandle)"</p>
<p><br>
</p>
<p>This call interpolates velocities in wrk to positions in pts and outputs in uvw.</p>
<p>The positions "pts" are positions of Lagranian particles.</p>
<p><br>
</p>
<p>Each process has a local array "pts" and a sees a local piece of the velocity field, "wrk".</p>
<p>Is it important that each point of "pts" is within the local piece of "wrk" for a processor?</p>
<p><br>
</p>
<p>* If this is important; how can I see that this is considered within the code?</p>
<p><br>
</p>
<p>* If it is not important; Could "intpts" be called only from one process (say nid == 0) in order to simplify the code?</p>
<p><br>
</p>
<p>Also: Have I understood the hemi example correctly?</p>
<p><br>
</p>
<p>Best,</p>
<p><br>
</p>
<p>Johan<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 2:26:20 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> Re: [Nek5000-users] Calling subroutine "hpts" for several files</font>
<div> </div>
</div>
<div><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>
</div>
</div>
</div>
</body>
</html>