- 积分
- 407
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-4-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大神,NCL刚入门,想画个多图,总提示我没定义这个变量,可是脚本根本没这个变量
begin
diri = "/home/zhangs/"
files = systemfunc("ls " + diri + "*monthly.nc")
f = addfiles(files,"r")
wks = gsn_open_wks("png","CT2016")
gsn_define_colormap(wks,"BlueRed")
;;;;;;;;;2013;;;;;;;;;;
it_s=201301
it_e=201312
time = f[:]->time
YYYYMM = cd_calendar(time,-1)
rec_s = ind(it_s.eq.YYYYMM)
rec_e = ind(it_e.eq.YYYYMM)
biofuel = f[:]->bio_flux_opt(rec_s:rec_e,:,:)
aa = dim_sum_n_Wrap(biofuel,0)
bb = aa*31536000
a2013 = bb*12 ; 1mol=12gC
copy_VarMeta(aa,a2013)
;;;;;;;;;;2014;;;;;;;;;;;;
it_s=201401
it_e=201412
time = f[:]->time
YYYYMM = cd_calendar(time,-1)
rec_s = ind(it_s.eq.YYYYMM)
rec_e = ind(it_e.eq.YYYYMM)
biofuel = f[:]->bio_flux_opt(rec_s:rec_e,:,:)
aa = dim_sum_n_Wrap(biofuel,0)
bb = aa*31536000
a2014 = bb*12 ; 1mol=12gC
copy_VarMeta(aa,a2014)
;;;;;;;;;;;;;2015;;;;;;;;;;;;;;;;;;
it_s=201501
it_e=201512
time = f[:]->time
YYYYMM = cd_calendar(time,-1)
rec_s = ind(it_s.eq.YYYYMM)
rec_e = ind(it_e.eq.YYYYMM)
biofuel = f[:]->bio_flux_opt(rec_s:rec_e,:,:)
aa = dim_sum_n_Wrap(biofuel,0)
bb = aa*31536000
a2015 = bb*12 ; 1mol=12gC
copy_VarMeta(aa,a2015)
plot = new(3,"graphic")
cmap = read_colormap_file("gui_default")
ncmap = dimsizes(cmap(:,0))
res = True
res@gsnRightString = "g/m2/yr"
res@gsnCenterString = "2013"
res@gsnCenterStringFontHeightF = 0.03
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
res@cnInfoLabelOn = False ; turn off cn info label
res@lbLabelBarOn = False ; turn off individual cb's
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = (/-50,-40,-30,-20,-10,0,10,20,30,40,50/)
res@cnFillColors = (/2,7,18,25,43,56,123,145,171,189,207,238/)
plot(0) = gsn_csm_contour_map(wks,a2013,res)
plot(1) = gsn_csm_contour_map(wks,a2014,res)
plot(2) = gsn_csm_contour_map(wks,a2015,res)
;************************************************
; create panel
;************************************************
resP = True ; modify the panel plot
resP@gsnFrame = False ; don't advance panel plot
resP@gsnPanelLabelBar = True ; add common colorbar
resP@gsnPanelMainString = "CT2016" ; new way of setting main title (as of NCL V6.4.0)
; resP@txString = "A common title" ; old way of setting main title
resP@gsnPanelBottom = 0.05 ; add space at bottom
resP@gsnPanelFigureStrings= (/"2013)","2014)","2015)"/) ; add strings to panel
resP@amJust = "TopLeft"
gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one plot
end
|
-
|