problems during loops

Stephen R McMillan smcmillan at PLANALYTICS.COM
Thu Aug 17 11:30:37 EDT 2006


Jose,
You need to put your timestep offsets within the quotes. Here's my 
suggested re-write (including a couple other corrections). Good luck! 
Stephen McMillan

'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





Jose Augusto Paixao Veiga <jaugusto at CPTEC.INPE.BR> 
Sent by: GRADSUSR at LIST.CINECA.IT
08/17/2006 10:22 AM
Please respond to
GRADSUSR at LIST.CINECA.IT


To
GRADSUSR at LIST.CINECA.IT
cc

Subject
problems during loops





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é

************************************************************************
The information contained in this e-mail message is intended only for the 
personal and confidential use of the recipient(s) named above and may 
contain information that is privileged, confidential, and/or proprietary 
to Planalytics, Inc. and its subsidiaries and affiliated companies.  This 
message may be an attorney-client communication and as such is privileged 
and confidential.  If the reader of this message is not the intended 
recipient or an agent responsible for delivering it to the intended 
recipient, you are hereby notified that you have received this document in 
error and that any review, dissemination, distribution, or copying of this 
message is strictly prohibited.  If you have received this communication 
in error, please notify the sender immediately by e-mail, and delete the 
original message.
************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20060817/8bb9666a/attachment.html 


More information about the gradsusr mailing list