- 积分
- 820
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-12-14
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2017-7-6 17:27:50
|
显示全部楼层
begin
f1=addfile("HadISST_sst.nc","r")
sst=f1->sst(:,:,:)
sst@missing_value=-1e+30
y=month_to_annual(sst, 1)
b=y(88:140,:,:)
copy_VarCoords(sst(0,:,:),b(0,:,:))
b!0="time"
time=ispan(1958,2010,1)
b&time=time
b&time@long_name="year"
b&time@units="year"
b@missing_value=-1e+30
;x=b
x=runave_n_Wrap(b, 3, 0, 0)
copy_VarCoords(b,x)
printVarSummary(x)
optEOF = False
optETS = False
neval =2
eof= eofunc_Wrap(x({latitude|:},{longitude|:},{time|:}),neval,optEOF)
eof_ts=eofunc_ts_Wrap (x({latitude|:},{longitude|:},{time|:}),eof, optETS)
eof_ts=eof_ts/10000
eof=eof*10000
;f1->ts=eof_ts
;print(max(eof(0,:,:)))
;print(max(eof(1,:,:)))
;print(min(eof(0,:,:)))
;print(min(eof(1,:,:)))
wks = gsn_open_wks("png","1950_2014hwf_std_eof(1)")
res2=True
res2@gsnDraw = False
res2@gsnFrame = False
res2@gsnAddCyclic = False
res2@mpCenterLonF = 100
res2@mpLimitMode = "LatLon"
res2@mpMinLatF = -40
res2@mpMaxLatF = 60
res2@mpMinLonF = -180
res2@mpMaxLonF = 180
res2@cnFillOn = True
;res2@cnFillPattern ="Explicit"
res2@cnLevelSelectionMode="ManualLevels"
res2@cnMinLevelValF=-0.6
res2@cnMaxLevelValF=0.6
res2@cnLevelSpacingF=0.1
;res2@cnFillColors=(/129,145,161,177,193,200,215,225/)
res2@mpDataBaseVersion="Ncarg4_1" ;ÖDμè·Ö±æÂê
res2@mpDataSetName="Earth..4" ;μú4°æμØí¼£¬óDÖD1ú±ß½çêy¾Y
res2@mpOutlineOn = True
res2@mpOutlineSpecifiers=(/"China:states","Taiwan"/) ;ÖD1ú±ß½çóDÎêìa£¬è±2ØÄÏ¡¢ì¨íå
res2@mpOutlineBoundarySets ="NoBoundaries"
res2@cnSmoothingOn =True
res2@cnRasterSmoothingOn= True
;gsn_define_colormap(wks,"leng")
;res2@tiMainString = "hwfeof(0)1950-2014dtrend"
;res2@tmXBMode = "Explicit"
;res2@tmXBValues = (/"70","80","90","100","110","120","130","140"/)
;res2@tmXBLabels = (/"70E","80E", "90E", "100E","110E","120E","130E","140E"/)
res2@cnMissingValFillColor="white"
rts2 = True
rts2@gsnDraw = False
rts2@gsnFrame = False
rts2@vpHeightF = 0.40 ; Changes the aspect ratio
rts2@vpWidthF = 0.80
rts2@vpXF = 0.80 ; change start locations
rts2@vpYF = 0.75 ; the plot
rts2@tiYAxisString = ""
rts2@tiXAxisString = "year"
rts2P = True ; modify the panel plot
rts2P@gsnMaximize = True ; large format
;rts2@trYMaxF=2
;rts2@trYMinF=-1.2
rts2@gsnYRefLine = 0. ; reference line
rts2@gsnXYBarChart = True ; create bar chart
rts2@gsnAboveYRefLineColor = "red" ; above ref line fill red
rts2@gsnBelowYRefLineColor = "blue" ; below ref line fill blue
rts2@tmXBMode = "Explicit"
rts2@tmXBValues=(/"1950","1960","1970","1980","1990","2000","2010"/)
rts2@tmXBLabels=(/"1950","1960","1970","1980","1990","2000","2010"/)
;rts2@tiMainString = "AP_Ts_02:1950-2014"
rts2@gsnLeftString = "EOF "+(0+1)
;rts2@gsnRightString = sprintf("%5.1f", eof@pcvar(1)) +"%"
plots = new(2,graphic)
res2@tiMainString = "1950_2014hwf-std-eof1"
res2@gsnLeftString = "EOF1 "
;cmap2 = read_colormap_file("14")
;res2@cnFillColors = cmap2
;gsn_define_colormap(wks,"14")
res2@gsnRightString = sprintf("%5.1f", eof@pcvar(0)) +"%"
plots(0) = gsn_csm_contour_map(wks,eof(0,:,:),res2)
plots(1)= gsn_csm_xy (wks,time,eof_ts(0,:),rts2)
pres = True
;pres@tiMainString = "1950_2014hwf_eof"
pres@gsnMaximize = True
pres@gsnPanelDebug=True
pres@gsnPanelRowSpec = True
pres@gsnPanelLabelBar = False
pres@lbBoxLinesOn = False
gsn_panel(wks,plots,(/1,2/),pres)
end
我自己的 |
|