<div dir="ltr">Hi,<div><br></div><div>The do loop that I use loads a sequence of .hdf files and I need to run about several hundred lines of code on it. The only alternative that I can think of is to have literally a do loop with several hundred lines of code in it. Surely there has to be a better way?</div><div><br></div><div>Cheers</div><div>Luke</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 9 June 2016 at 02:55, Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Luke,<br><br></div>It looks like what we are seeing is that each call to loadscript() is a directive to load script that is to be queued-up and executed at the conclusion of the loop.  I don&#39;t get that understanding from the docs, and I can&#39;t say if its intended behavior or not. <br><br></div>In any case, I&#39;m not sure what you are trying to do, but repeatedly loading a script inside a loop sounds like a lot od duplication and performance overhead.  Is there other way to refactor your code?<br><br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jun 8, 2016 at 2:18 AM, Luke Osburn <span dir="ltr">&lt;<a href="mailto:luke.osburn@monash.edu" target="_blank">luke.osburn@monash.edu</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi all,<div><br></div><div>I have run into something of a problem. I have a lot of code that needs to run on a lot of data and anticipated being able to use the loadscript function within do loops but it works in an odd way: a much simpler example:<br><br>&quot;Original script&quot;<br><div>do ray=0,3</div><div>   loadscript(&quot;sunshine.ncl&quot;)</div><div>end do<br><br>Where sunshine.ncl is:</div><div><br></div><div><div>xx=ray*2</div><div>print(xx)</div><br>The output of this combination of scripts is:</div><div><br></div><div>8</div><div>8</div><div>8</div><div>8</div><div><br></div><div>But I want to be able to use the value of ray in &quot;Sunshine.ncl&quot; as it loops and get:</div><div><br></div><div>0</div><div>2</div><div>4</div><div>6</div><div><br></div><div>If anyone knows how to achieve something like this or a workaround that would be greatly appreciated.</div><div><br></div><div>Regards</div><div>Luke</div><div><br></div><div><br></div><div><div>There were no errors reported.</div><div>NCAR Command Language Version 6.3.0<br></div><div>Linux s0000965 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux</div><div><br></div></div><div><br></div><div><br></div><div><br></div></div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>