<div dir="ltr"><div>Thanks Rick,</div><div>I want to use task parallelism. I have hourly files spanning a few months from a high resolution simulation. It takes a lot of time to read a variable and generate a plot. I have come across task parallelism (example 3) and want to modify the example such that I can use 24 processors to read 24 files at a time and save the desired variable in a parent array. And once the reading is complete, I can perform calculations (daily/monthly stats) on the parent array. I hope this helps understand what I intend to do.</div><div>You mentioned a file based approach...and perhaps the example 3 does save individual plots and later combine frames. I wonder if it's good idea in my case????</div><div>Best regards,</div><div>Jayant<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 20, 2021 at 11:50 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>If I understand you correctly, you are trying to get the second script to update the array in the first script?  If so, that would not be possible, as the two scripts execute as independent processes, operating in independent memory spaces. They would need some other mechanism to communicate results between each other, perhaps something like a file-based approach. </div><div><br></div><div>Perhaps explain in more detail what you are trying to do and why there are two scripts involved, and others might be able to offer suggestions.<br></div><div><br></div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 20, 2021 at 8:26 PM Jayant via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>I want to call one ncl script (test_second.ncl) from within another ncl script (test_prime.ncl) using <span style="font-family:monospace">system</span> command (in fact <span style="font-family:monospace">subprocess</span> command). In doing so, I want to update an array (defined in test_prime.ncl) in the second call. I am getting zeros (unchanged!!). How to proceed? Is there something like global variables that can be defined? Below are the working example scripts:</div><div>;==================================================</div><div><b>test_prime.ncl</b></div><div><span style="font-family:monospace">begin<br> ninp=10<br> <span style="color:rgb(255,0,0)">inparr</span>=new(ninp,float)<br> inparr=0.0<br><br> do i=0,ninp-1<br>  command="ncl -Q test_second.ncl "+str_get_sq()+"ip="+i+str_get_sq()+" "+str_get_sq()+"tmparr="+<span style="color:rgb(255,0,0)">inparr(i)</span>+str_get_sq()<br>  system(command)<br> end do<br>print(<span style="color:rgb(255,0,0)">inparr</span>)<br>end</span></div><div>;==================================================<br></div><div><b>test_second.ncl</b></div><div><span style="font-family:monospace">begin<br></span><div style="margin-left:40px"><span style="font-family:monospace">tmparr=ip ; intend to perform some calculation and update<br></span></div><span style="font-family:monospace">end</span></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>