<div dir="ltr"><div><div>How about this? Replace the integer 1 with a script variable year, and integer 2 with scrip variable tvalue.<br><br></div><div>year=1<br></div><div>tvalue=673<br></div>*start loop<br></div><div>while(loop&lt;=672)<br>
</div><div>*your loops, example<br></div><div>&#39;define y&#39;year&#39;=pdsi.1(t=&#39;tvalue&#39;)&#39;<br></div><div>year=year+1<br></div><div>tvalue=tvalue+1<br></div><div>endwhile<br><br></div><div>Notice that y1= becomes y&#39;year&#39;= . If you want to put the variable at then end, say you want to display t1 until t672, you need to leave out the &#39; mark at the end, example<br>
<br></div><div>&#39;display t&#39;year<br><br></div><div>Its the same if you&#39;re using something in the front. <br><br></div><div>variable&#39;mean=something(something)&#39;<br></div><div><br>The script variable are in string, so you can do lots of things with it, including looping variables being plotted, automated plots title corresponding to time of your choosing and others. So in one loop, you can calculate, plot (with correspoding title, matching contours or shades) and save them in pictures or binaries form.<br>
</div><div><br></div><div>For more information, please refer to GrADS scripting. <br><br></div><div>Yunus<br><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 3, 2013 at 4:42 AM, Emily Wilson <span dir="ltr">&lt;<a href="mailto:wilson.emily.parker@gmail.com" target="_blank">wilson.emily.parker@gmail.com</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>Hello! I need help formatting a loop command in a GrADS script.  I am using GrADS to extract PDSI data from a NetCDF file.  My script so far looks like this....<br>
<br> &#39;reinit&#39;<br>*<br> &#39;sdfopen <a href="http://pdsi.mon.mean.selfcalibrated.nc" target="_blank">pdsi.mon.mean.selfcalibrated.nc</a>&#39;<br>
*<br> &#39;enable print grads.outfile&#39;<br>  say &#39;** OUTPUT FILE: grads.outfile&#39;<br> &#39;clear&#39;<br> &#39;set grads off&#39;<br> &#39;set mpdset lores&#39; <br> &#39;set lon -106 -106&#39;<br> &#39;set lat 40 40&#39;<br>

*<br>*<br>  &#39;define y1=pdsi.1(t=673)&#39;<br><br><br></div>Now I want to define y1 thru y1260 with corresponding t= values starting at 673 and ending with 1936.  Instead of typing all of this out, I know I can use a loop but I do not no how to format that code.  Could someone please help me format this loop.<br>

</div>Thanks in advance,<br clear="all"><div><div><div><div><div dir="ltr"><span style="color:rgb(106,168,79)"><b>Emily P. Wilson, Intern</b></span><br><span style="color:rgb(61,133,198)">Research and Conservation Department<br>

Denver Botanic Gardens<br>1007 York St.<br>Denver, CO 80206<br><a href="tel:720-865-3593" value="+17208653593" target="_blank">720-865-3593</a></span></div></div>
</div></div></div></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>