Hi, I am trying to make a timeseries plot with gsn_csm_xy() but I keep
getting the error:
fatal:Argument type mismatch on argument (1) of gsn_csm_xy can not coerce
I am not sure why? I thought you could do it if your time variable was a
string.
Here is my code,
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
site =
(/"cco","ccy","crn","drn","ffm","klm","lcd","lgt","log","mck","mhl", \
"mta","ovl","pan","pld","ser","smt","std","svc"/)
ns = dimsizes(site)
;do s=0,ns-1
do s=0,0
filename= "./"+site(s)+"/"+site(s)+".txt"
lines = asciiread(filename,-1,"string")
delim = ","
yyjjj = tointeger(str_get_field(lines,1,delim))
time = str_get_field(lines,2,delim)
iwv = tofloat(str_get_field(lines,3,delim))
jjj=mod(yyjjj,1000)
jjj@calendar="julian"
jjj@units="days since 2011-12-31"
YYYYNNDD=tostring(cd_calendar(jjj,-2))
NN=str_get_cols(YYYYNNDD,4,5)
DD=str_get_cols(YYYYNNDD,6,7)
HH=str_get_cols(time,0,1)
MM=str_get_cols(time,3,4)
date=NN+"/"+DD+" "+HH+":"+MM
iwv@_FillValue = -9.99
wks = gsn_open_wks("x11","cco_iwv")
res = True
printVarSummary(date)
printVarSummary(iwv)
plot = gsn_csm_xy(wks,date,iwv,res)
delete([/lines,yyjjj,time,iwv,jjj/])
end do
end
-- Arthur J. Eiserloh, Jr. San Jose State University Graduate Student Dept. of Meteorology and Climate Science
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Dec 9 10:54:54 2013
This archive was generated by hypermail 2.1.8 : Fri Dec 13 2013 - 11:39:30 MST