string to numeric value??

Haibin Li haibin1977 at GMAIL.COM
Fri Jan 21 14:57:37 EST 2005


Dear All,
I am in a process to plot time series for multiple model outputs.
Since the models don't have the same initial time, I want to write a
script to determine how to " set t t1 t2".
Here is part of my script:
----------------------------------------------
'q time'
res=subwrd(result,3)
say 'time is 'res
year=substr(res,9,4)
say 'Year is 'year
Yrst.1=1984    %The start year.
Yred.1=1999   %The end year.
%The following two lines are for the purpose to determine t1 and t2
based on monthly data.
t1=(Yrst.1-year)*12+1
t2=(Yred.1-year+1)*12
say 't1 is  't1
say 't2 is 't2
--------------------------------------------------
But there is a problem since the variable "year" from subwrd is a string not
number, so I got error information about using string as number in GrADS.
Can someone tell me how to do this trick if there is a way?
Thanks

Yours,
Haibin


----------------------------------------------



More information about the gradsusr mailing list