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

Yi-Chih Huang dscpln at gmail.com
Sat Nov 26 14:42:23 EST 2011


Hello,

    Thanks much for the response.  After I removed "set t "i, the error
messages are follows.  I am wondering why "set lat 23.46" was not working
and what would be the right commands to display the time-longitude diagram?

################################
...........................
Data Request Error: Invalid dimension expression
  Attempt to set or modify varying dimension
  Variable = rainnc, Dimension = 3
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = rainnc(t=55)-rainnc(t=54)
56
Data Request Error: Invalid dimension expression
  Attempt to set or modify varying dimension
  Variable = rainnc, Dimension = 3
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = rainnc(t=56)-rainnc(t=55)
57
Data Request Error: Invalid dimension expression
  Attempt to set or modify varying dimension
  Variable = rainnc, Dimension = 3
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = rainnc(t=57)-rainnc(t=56)
58
Cannot plot color bar: No shading information
###############################################

    Thanks much for your help,

                        Yi-Chih


On Sat, Nov 26, 2011 at 11:53 AM, Rowell, Mason D.
<Mason.D.Rowell-1 at ou.edu>wrote:

>  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
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111126/1fa37b4e/attachment-0003.html 


More information about the gradsusr mailing list