Hi All,
I am trying to plot index values into 3 panels and getting following errors:
fatal:Undefined identifier: (dimx) is undefined, can't continue
fatal:Execute: Error occurred at or near line 63 in file t3.ncl
fatal:Variable (plots) is undefined
fatal:Execute: Error occurred at or near line 75 in file t3.ncl
fatal:syntax error: line 76 in file t3.ncl before or near end
end
--^
Below is my script. Please help to correct it. Thanks!
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
wks = gsn_open_wks("x11","stanom") ; open a ps plot
res = True ; make plot mods
res@gsnDraw= False
res@gsnFrame= False
res@xyLineThicknesses = (/1.,2.,1.,2./)
;res@xyLineColors = (/"pinkred","red","lightblue","blue"/)
res@xyDashPatterns = (/0.,0.,0.,0./) ; make all
lines solid
res@trYMinF = -5.0 ; bring bars down to zero
res@trYMaxF = 5.0 ; adds space on either end
res@trXMinF = 1980
res@trXMaxF = 2000
res@gsnYRefLine = 0. ; reference line
;res@tiXAxisString = "Time(years)" ; x-axis label
;res@tiYAxisString = "Standardized Anomaly" ; x-axis label
do i=0,2
j=i+6
filename1 = "pkc."+sprinti("%0.2i",j)+".wa.nc"
f1 = addfile("pkc.06.wa.nc","r")
print(f1)
filename2 = "pks."+sprinti("%0.2i",j)+".wa.nc"
f2 = addfile("pks.06.wa.nc","r")
print(f2)
a1 = f1->pre
a2 = f2->pre
x1 = dim_standardize_Wrap(a1,1)
x2 = runave(x1,3,0)
x3 = dim_standardize_Wrap(a2,1)
x4 = runave(x3,3,0)
dimx1 = dimsizes(x1)
dimx2 = dimsizes(x2)
dimx3 = dimsizes(x3)
dimx4 = dimsizes(x4)
dimmx = max((/dimx1,dimx2,dimx3,dimx4/))
time = ispan(1980,2000,1)
data = new((/4,dimmx/),typeof(a1))
do k=0,3
data(k,:dimx(k+1)-1) = x(k+1)
;data(0,:dimx1-1) = x1
;data(1,:dimx2-1) = x2
;data(2,:dimx3-1) = x3
;data(3,:dimx4-1) = x4
plots(i) = gsn_csm_xy(wks,time,data(k),res)
end do
end do
pres = True
pres@gsnMaximize = True
gsn_panel(wks,plots,(/3,1/),pres)
end
exit
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 22 21:07:53 2010
This archive was generated by hypermail 2.1.8 : Tue Jan 04 2011 - 09:16:52 MST