problems during loops

Charles Seman Charles.Seman at NOAA.GOV
Thu Aug 17 11:28:57 EDT 2006


Jose,

Could you try something like this?

'set t 6 360'
'define ke5 = 0.6*ke(t-2)+0.8*ke(t-1)+ke(t+0)+0.8*ke(t+1)+0.6*ke(t+2)'

I hope this helps,
Chuck

Jose Augusto Paixao Veiga wrote:
> Hi dear users
> I am triyng to write a very simple program using grads. The program is put
> bellow
>
> 'reinit'
> 'open arc.ctl'
>
> i=6
> while (i>=6 & i<=360 )
> 'set t ' i
> say time' 'i
>
> 'd 0.6*ke(t='i'-2)+0.8*ke(t='i'-1)+ke(t='i')+0.8*ke(t='i'+1)+0.6*ke(t='i'+2)'
>
> i=i+1
> endwhile
>
> the error message is:
>
> tempo 6
> Syntax Error:  Invalid dimension expression
>   Expecting X/Y/Z/T/LAT/LON/LEV/TIME, found
>   Variable name = ke
>   Error ocurred at column 5
> DISPLAY error:  Invalid expression
>   Expression =
> 0.1*ke(t=6-5)+0.2*ke(t=6-4)+0.4*ke(t=6-3)+0.6*ke(t=6-2)+0.8*ke(t=6-1)+ke(t=6)+0.8*ke(t=6+1)+0.6*ke(t=6+2)+0.4*ke(t=6+3)+0.2*ke(t=6+4)+0.1*ke(t=6+5)
>
>
> In this case what could be done?
>
> Thanks in advance for comments and help
> José
>

--

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."



More information about the gradsusr mailing list