- 积分
- 3208
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-6-18
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
利用月平均资料算年平均,用的是month_to_annual。为啥出现缺省值报错,如果只画冬季的话是可以的。求大神解答!!!
begin
latS =-30
latN =30
lonL =120
lonR =290
yrStrt =1950
yrLast =2017
neof =3
optEOF =True
optETS =False
diri="D:\"
fili="sj\now\sst-195001-201712.nc"
f=addfile(diri+fili,"r")
TIME = f->time
YYYY =cd_calendar(TIME, -1)/100
iYYYY=ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
sst = f->sst(iYYYY,:,:)
SST =month_to_annual(sst, 1)
nyrs =dimsizes(SST&time) ;;;;;;;;;;;;;;;;;;;23行在这里
xw =SST(time|:,{rlat|latS:latN},{rlon|lonL:lonR})
;EOF==========================
eof =eofunc_n_Wrap(xw, neof, optEOF,0)
eof_ts =eofunc_ts_n_Wrap(xw, eof, optETS,0)
yyyymm =cd_calendar(eof_ts&time,-2)/100
;============================================================
; PLOTS
;============================================================
wks = gsn_open_wks("png","eof")
plot = new(neof,graphic)
res = True
res@mpCenterLonF =180
res@gsnDraw = False ; don't draw yet
res@gsnFrame = False ; don't advance frame yet
res@gsnAddCyclic = False ; plotted dataa are not cyclic
res@mpFillOn = False ; turn off map fill
res@mpMinLatF = latS ; zoom in on map
res@mpMaxLatF = latN
res@mpMinLonF = lonL
res@mpMaxLonF = lonR
res@vpHeightF =0.4
res@vpWidthF =0.7
res@cnFillOn = True ; turn on color fill
res@cnLinesOn = False ; True is default
;res@cnLineLabelsOn = False ; True is default
res@cnFillPalette = "BlWhRe" ; set color map
res@lbLabelBarOn = False ; turn off individual lb's
symMinMaxPlt(eof, 16, False, res)
; panel plot only resources
resP = True ; modify the panel plot
resP@gsnMaximize = True ; large format
resP@gsnPanelLabelBar = True ; add common colorbar
yStrt = yyyymm(0)/100
yLast = yyyymm(nyrs-1)/100
resP@gsnPanelMainString = "1950-2017"
;*******************************************
; first plot
;*******************************************
do n=0,neof-1
res@gsnLeftString = "EOF "+(n+1)
res@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"
plot(n)=gsn_csm_contour_map(wks,eof(n,:,:),res)
end do
gsn_panel(wks,plot,(/neof,1/),resP) ; now draw as one plot
;==================================================================
; EOF time series [bar form]
eof_ts@long_name = "Amplitude"
rts = True
rts@gsnDraw = False ; don't draw yet
rts@gsnFrame = False ; don't advance frame yet
;rts@gsnScale = True ; force text scaling
; these four resources allow the user to stretch the plot size, and
; decide exactly where on the page to draw it.
rts@vpHeightF = 0.40 ; Changes the aspect ratio
rts@vpWidthF = 0.85
rts@vpXF = 0.10 ; change start locations
rts@vpYF = 0.75 ; the plot
rts@gsnYRefLine = 0. ; reference line
rts@gsnAboveYRefLineColor = "red" ; above ref line fill red
rts@gsnBelowYRefLineColor = "blue" ; below ref line fill blue
; panel plot only resources
rtsP = True ; modify the panel plot
rtsP@gsnMaximize = True ; large format
year =yyyymm/100
resP@gsnPanelMainString = "SCRIPPS: Pierce"
do n=0,neof-1
rts@gsnLeftString = "EOF "+(n+1)
rts@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"
plot(n) = gsn_csm_xy (wks,year,eof_ts(n,:),rts)
end do
gsn_panel(wks,plot,(/neof,1/),rtsP) ; draw all 'neof' as one plot
end
报错的地方如下
(0) month_to_annual: some grid points have missing data: nt=0 nyr=0 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=12 nyr=1 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=24 nyr=2 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=36 nyr=3 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=48 nyr=4 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=60 nyr=5 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=72 nyr=6 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=84 nyr=7 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=96 nyr=8 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=108 nyr=9 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=120 nyr=10 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=132 nyr=11 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=144 nyr=12 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=156 nyr=13 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=168 nyr=14 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=180 nyr=15 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=192 nyr=16 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=204 nyr=17 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=216 nyr=18 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=228 nyr=19 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=240 nyr=20 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=252 nyr=21 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=264 nyr=22 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=276 nyr=23 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=288 nyr=24 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=300 nyr=25 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=312 nyr=26 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=324 nyr=27 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=336 nyr=28 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=348 nyr=29 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=360 nyr=30 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=372 nyr=31 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=384 nyr=32 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=396 nyr=33 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=408 nyr=34 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=420 nyr=35 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=432 nyr=36 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=444 nyr=37 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=456 nyr=38 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=468 nyr=39 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=480 nyr=40 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=492 nyr=41 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=504 nyr=42 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=516 nyr=43 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=528 nyr=44 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=540 nyr=45 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=552 nyr=46 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=564 nyr=47 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=576 nyr=48 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=588 nyr=49 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=600 nyr=50 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=612 nyr=51 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=624 nyr=52 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=636 nyr=53 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=648 nyr=54 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=660 nyr=55 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=672 nyr=56 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=684 nyr=57 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=696 nyr=58 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=708 nyr=59 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=720 nyr=60 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=732 nyr=61 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=744 nyr=62 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=756 nyr=63 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=768 nyr=64 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=780 nyr=65 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=792 nyr=66 num(nGood)=10988
(0) month_to_annual: some grid points have missing data: nt=804 nyr=67 num(nGood)=10988
fatal:(time) is not a named dimension in variable (SST).
fatal:["Execute.c":8638]:Execute: Error occurred at or near line 23
|
|