Expression error

James D Scott James.D.Scott at NOAA.GOV
Wed Mar 23 10:59:19 EST 2005


When using lot's of variables in expressions, I find it useful to
see how grads is interpreting them.  You can do this with the
say command:

say   'define
D'YY'=ave(hgtprs.'YY',time=00Z01DEC'%ys',time=00Z31DEC'%ye')'

Then verify that these coordinates are actually available in the file.
  This
is what grads is complaining about...

-Jamie

On Mar 22, 2005, at 8:07 PM, Charles wrote:

> Hi!
> Ihave some question about 'define' expression.
> There are 93 ctl files opened in my script,
> and my script is:
>
> 'reinit'
> '/u142/plotting/lib/1985.gs'
> '/u142/plotting/lib/1989.gs'
> '/u142/plotting/lib/2001.gs'
> 'set display color white'
> 'c'
> YY=1
> sum0=0
> while(YY<=93)
> if(YY<=26);ys=1985;ye=1986;endif
> if(26<YY<=31);ys=85;ye=86;endif
> if(31<YY<=54);ys=1989;ye=1990;endif
> if(54<YY<=62);ys=89;ye=90;endif
> if(62<YY<=93);ys=2001;ye=2002;endif
> 'set dfile 'YY
>   'set t 1'
>   'define D'YY'=ave(hgtprs.'YY',time=00Z01DEC'%ys',time=00Z31DEC'%ye')'
>   'define SUM'YY'=SUM'YY-1'+D'YY''
> YY=YY+1
> endwhile
>
> After running it,I got this error:
>
> Data Request Warning: Request beyond file limits
> Error from AVE: Error getting grids
> Operation Error: Error from ave function
> Error occurred at column 1
> DEFINE error: Invalid expression
>
> Could anyone tell me what mistake I make?
> Thanks for any help!



More information about the gradsusr mailing list