[gradsusr] the commands with variables change in a while loop online

Rowell, Mason D. Mason.D.Rowell-1 at ou.edu
Sat Nov 26 11:53:24 EST 2011


Hello there,

I think if you remove the "set t"i, you will get what you want. That way you don't fix time to some number (which is why you are getting a one dimensional plot for all iterations), your loop will still run and produce the difference you need for each iteration, and the time variable will still be set for the variation in time you seek for all iterations. In other words, you don't need to set t to i before your next statement, the use of functional notation like in your difference statement should work independently of setting the time dimension. However, I'll qualify that by stating I just learned of this functional capability, so someone should probably back me up.

Mason
________________________________
From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on behalf of Yi-Chih Huang [dscpln at gmail.com]
Sent: Saturday, November 26, 2011 9:12 AM
To: GrADS Users Forum
Subject: Re: [gradsusr] the commands with variables change in a while loop online

Hello,

    I am trying to generate a diagram with time as y axis and longitude as x axis.  Without the calculation of time, it is easy to generate such a diagram.  When the calculations include time, what would the program looks like to generate the time-longitude diagram?  The following script only resulted in many one-dimensional diagrams.

########################
"set t 1 57"
"set x 1 138"
"set lat 23.46"
"set parea 1.5  9.7 1 8.3"
"set gxout shaded"
i=2
while (i<58)
   "set t "i
   "d rainnc(t="i") - rainnc(t="i-1")"
   i=i+1
endwhile
#######################

    Thanks much for your help,

                Yi-Chih
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111126/c23f2839/attachment-0003.html 


More information about the gradsusr mailing list