problems during loops
José Paixão
jaugusto_veiga at YAHOO.COM.BR
Thu Aug 17 13:04:37 EDT 2006
dear friendy, my problem was solved when I put everybody in parenthesis between ' ', like in
'd 0.1*ke(t= 'i-5' )+0.2*ke(t= 'i-4' )+0.4*ke(t= 'i-3' )+ ....'
thanks for your comments
José
Charles Seman <Charles.Seman at NOAA.GOV> escreveu: 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."
---------------------------------
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20060817/55088adf/attachment.html
More information about the gradsusr
mailing list