error in max command with while loop

James T. Potemra jimp at HAWAII.EDU
Tue May 5 02:06:09 EDT 2009


Dipak:

I think you need to distinguish between the value of tt and the variable
using
single quotes.  Instead of
'd max(tc,t=tt,t=tt+8)'
try
'd max(tc,t='tt',t='tt'+8)'

In other words, try move the variable tt outside the single quotes.

Jim

dipak sahu wrote:
> Hii all users
>      Here i faced some problem in grads looping , actually i want to
> extract the maximum values of each 24hr(1day) simulation of a 1month
> simulation .dat file. so for this i tried the command
> d max(tc, t=1,t=9) --> this the command to find the maximum value of
> 1st day (of 3hrly output saved file)
> so similarly i've to write this command for each day upto t=248, 31
> times.But i want to  implement the while loop to do this like
>
> reinit'
> 'open test-uprobe-3dvar.ctl'
> 'set lat 29.45'
> 'set lon 80.16'
> 'set lev 850'
> 'set gxout fwrite'
> 'set fwrite maximum-temp-thal-3dvar.dat'
> tt = 1
> while (i<=241)
> *'set t 'tt
> 'd max(tc,t=tt,t=tt+8)'
> tt=tt+8
> endwhile
> 'disable fwrite'
> ~
> but this script file wasn't working. actually it was not taking the
> value of "tt" inside the max command. So anybody has any idea
> regarding to this issue, kindly suggest me.
>
> thanking you in advance
> with regards
>
> --
> ********************************************
> Dipak kumar Sahu,
> Research Scholar,
> Centre for Atmospheric Sciences.,
> Indian Institute of Technology,Delhi
> email:- dipak.sahu at iitd.acads.in <mailto:dipak.sahu at iitd.acads.in>
> **********************************************



More information about the gradsusr mailing list