[ncl-talk] irregular coordinate array sfXArray non-monotonic: defaulting sfXArray
WIND
954051157 at qq.com
Tue Sep 27 06:18:11 MDT 2016
Hi all,
I'm working on a latitude v.s. month contour plot. But it's hard for me to change the xArray and says irregular coordinate array sfXArray non-monotonic: defaulting sfXArray . It's appreciate if you could help me check my script. Thanks a lot!
f1 = addfile("JanTmon.nc","r")
t1 = short2flt( f1->t )
year1=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt1=t1(:,:,0)
ttt1=dim_avg_n(t1,2)
copy_VarMeta(tt1,ttt1)
t1new=ttt1(latitude|:,time|:)
rc1 = regCoef(year1,t1new)
f2 = addfile("FebTmon.nc","r")
t2 = short2flt( f2->t )
year2=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt2=t2(:,:,0)
ttt2=dim_avg_n(t2,2)
copy_VarMeta(tt2,ttt2)
t2new=ttt2(latitude|:,time|:)
rc2 = regCoef(year2,t2new)
f3 = addfile("MarTmon.nc","r")
t3 = short2flt( f3->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt3=t3(:,:,0)
ttt3=dim_avg_n(t3,2)
copy_VarMeta(tt3,ttt3)
t3new=ttt3(latitude|:,time|:)
rc3 = regCoef(year,t3new)
f4 = addfile("AprTmon.nc","r")
t4 = short2flt( f4->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt4=t4(:,:,0)
ttt4=dim_avg_n(t4,2)
copy_VarMeta(tt4,ttt4)
t4new=ttt4(latitude|:,time|:)
rc4 = regCoef(year,t4new)
f5 = addfile("MayTmon.nc","r")
t5 = short2flt( f5->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt5=t5(:,:,0)
ttt5=dim_avg_n(t5,2)
copy_VarMeta(tt5,ttt5)
t5new=ttt5(latitude|:,time|:)
rc5 = regCoef(year,t5new)
f6 = addfile("JunTmon.nc","r")
t6 = short2flt( f6->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt6=t6(:,:,0)
ttt6=dim_avg_n(t6,2)
copy_VarMeta(tt6,ttt6)
t6new=ttt6(latitude|:,time|:)
rc6 = regCoef(year,t6new)
f7 = addfile("JlyTmon.nc","r")
t7 = short2flt( f7->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt7=t7(:,:,0)
ttt7=dim_avg_n(t7,2)
copy_VarMeta(tt7,ttt7)
t7new=ttt7(latitude|:,time|:)
rc7 = regCoef(year,t7new)
f8 = addfile("AugTmon.nc","r")
t8 = short2flt( f8->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt8=t8(:,:,0)
ttt8=dim_avg_n(t8,2)
copy_VarMeta(tt8,ttt8)
t8new=ttt8(latitude|:,time|:)
rc8 = regCoef(year,t8new)
f9 = addfile("SepTmon.nc","r")
t9 = short2flt( f9->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt9=t9(:,:,0)
ttt9=dim_avg_n(t9,2)
copy_VarMeta(tt9,ttt9)
t9new=ttt9(latitude|:,time|:)
rc9 = regCoef(year,t9new)
f10 = addfile("OctTmon.nc","r")
t10 = short2flt( f10->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt10=t10(:,:,0)
ttt10=dim_avg_n(t10,2)
copy_VarMeta(tt10,ttt10)
t10new=ttt10(latitude|:,time|:)
rc10 = regCoef(year,t10new)
f11 = addfile("NovTmon.nc","r")
t11 = short2flt( f11->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt11=t11(:,:,0)
ttt11=dim_avg_n(t11,2)
copy_VarMeta(tt11,ttt11)
t11new=ttt11(latitude|:,time|:)
rc11 = regCoef(year,t11new)
f12 = addfile("DecTmon.nc","r")
t12 = short2flt( f12->t )
year=(/1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000/)
tt12=t12(:,:,0)
ttt12=dim_avg_n(t12,2)
copy_VarMeta(tt12,ttt12)
t12new=ttt12(latitude|:,time|:)
rc12 = regCoef(year,t12new)
data=new((/12,dimsizes(rc12)/),float)
data(0,:)=rc6
data(1,:)=rc7
data(2,:)=rc8
data(3,:)=rc9
data(4,:)=rc10
data(5,:)=rc11
data(6,:)=rc12
data(7,:)=rc1
data(8,:)=rc2
data(9,:)=rc3
data(10,:)=rc4
data(11,:)=rc5
data=data*10
lat=f1->latitude
data!1="la"
lat=f1->latitude
data&la=lat
data!0="month"
data&month=(/6,7,8,9,10,11,12,1,2,3,4,5/)
datareverse=data(la|:,month|:)
wks = gsn_open_wks("eps" ,"12")
res = True
res at cnLevelSelectionMode = "ManualLevels"
resources at tmXBMode = "Explicit"
resources at tmXBValues = ispan(0,12,1); Values from 0 to 12.
resources at tmXBLabels = (/"J","J","A","S","O","N","D","J","F","M","A","M"/)
res at cnMinLevelValF = -4
res at cnMaxLevelValF = 4
res at cnLevelSpacingF = 0.5
plot = gsn_csm_contour(wks,datareverse,res)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160927/59c9ad95/attachment.html
More information about the ncl-talk
mailing list