<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<=672)<br>
</div><div>*your loops, example<br></div><div>'define y'year'=pdsi.1(t='tvalue')'<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'year'= . If you want to put the variable at then end, say you want to display t1 until t672, you need to leave out the ' mark at the end, example<br>
<br></div><div>'display t'year<br><br></div><div>Its the same if you're using something in the front. <br><br></div><div>variable'mean=something(something)'<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"><<a href="mailto:wilson.emily.parker@gmail.com" target="_blank">wilson.emily.parker@gmail.com</a>></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> 'reinit'<br>*<br> 'sdfopen <a href="http://pdsi.mon.mean.selfcalibrated.nc" target="_blank">pdsi.mon.mean.selfcalibrated.nc</a>'<br>
*<br> 'enable print grads.outfile'<br> say '** OUTPUT FILE: grads.outfile'<br> 'clear'<br> 'set grads off'<br> 'set mpdset lores' <br> 'set lon -106 -106'<br> 'set lat 40 40'<br>
*<br>*<br> 'define y1=pdsi.1(t=673)'<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>