- 积分
- 1520
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-12-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
自己刚用完的脚本贴出来大家一起学习,相互借鉴
begin
f = addfile("f:/fout/hgt.nc","r")
hgt = f ->hgt
hgt_DJF=new((/56,21,29/),"float")
hgt_DJF!0 = "time"
hgt_DJF!1 = "lat"
hgt_DJF&lat = f ->lat
hgt_DJF!2 = "lon"
hgt_DJF&lon = f ->lon
ntime = 0
do i=0,167,3
hgt_DJF(ntime,:,:)=(hgt(i,:,:)+hgt(i+1,:,:)+hgt(i+2,:,:))/3
ntime = ntime+1
end do
avg_hgt = new((/21,29/),"float")
avg_hgt !0 = "lat"
avg_hgt &lat = f->lat
avg_hgt !1 = "lon"
avg_hgt &lon = f->lon
avg_hgt(:,:) = dim_avg_n_Wrap(hgt_DJF,0)
ano_hgt = new((/56,21,29/),"float")
ano_hgt!0 = "time"
ano_hgt!1 = "lat"
ano_hgt&lat = f->lat
ano_hgt!2 = "lon"
ano_hgt&lon = f->lon
do t = 0,56-1
ano_hgt(t,:,:) = hgt_DJF(t,:,:)-avg_hgt(:,:)
end do
nino = (/3,5,8,9,12,16,17,22,26,27,31,32,34,37,42,44,46,49,55/)
lano = (/4,10,11,13,14,15,28,38,39,50/)
avg_ano_nino = new((/21,29/),"float")
avg_ano_nino!0 = "lat"
avg_ano_nino&lat = f->lat
avg_ano_nino!1 = "lon"
avg_ano_nino&lon = f->lon
sum_nino = new((/21,29/),"float")
sum_nino!0 = "lat"
sum_nino&lat = f->lat
sum_nino!1 = "lon"
sum_nino&lon = f->lon
sum_nino = 0.
do i = 0,19-1
sum_nino = sum_nino+ano_hgt(nino(i),:,:)
end do
avg_ano_nino = sum_nino/19.
avg_ano_lano = new((/21,29/),"float")
avg_ano_lano!0 = "lat"
avg_ano_lano&lat = f->lat
avg_ano_lano!1 = "lon"
avg_ano_lano&lon = f->lon
sum_lano = new((/21,29/),"float")
sum_lano!0 = "lat"
sum_lano&lat = f->lat
sum_lano!1 = "lon"
sum_lano&lon = f->lon
sum_lano = 0.
do i = 0 ,10-1
sum_lano = sum_lano+ano_hgt(lano(i),:,:)
end do
avg_ano_lano = sum_lano/10.
avg_ano_c = new((/21,29/),"float")
avg_ano_c!0 = "lat"
avg_ano_c&lat = f->lat
avg_ano_c!1 = "lon"
avg_ano_c&lon = f->lon
avg_ano_c = avg_ano_nino-avg_ano_lano
wks=gsn_open_wks("png","hgtN")
res=True
res@gsnAddCyclic=False
res@gsnMaximize=True
res@mpDataBaseVersion="MediumRes"
res@mpDataSetName="Earth..4"
res@mpOutlineOn=True
res@mpFillOn = True
res@mpOutlineSpecifiers=(/"China","Taiwan"/)
res@mpGeophysicalLineThicknessF=2.0
res@mpNationalLineThicknessF=2.0
res@mpMinLatF=15.0
res@mpMaxLatF=55.0
res@mpMinLonF=70
res@mpMaxLonF=135.0
res@cnLinesOn=True
res@cnFillOn = True
res@cnLineLabelsOn=True
;res@cnLevelSelectionMode="AutomaticLevels"
plot=gsn_csm_contour_map(wks,avg_ano_nino,res)
res2=True
res2@gsnAddCyclic=False
res2@gsnMaximize=True
res2@mpDataBaseVersion="MediumRes"
res2@mpDataSetName="Earth..4"
res2@mpOutlineOn=True
res2@mpFillOn = True
res2@mpOutlineSpecifiers=(/"China","Taiwan"/)
res2@mpGeophysicalLineThicknessF=2.0
res2@mpNationalLineThicknessF=2.0
res2@mpMinLatF=15.0
res2@mpMaxLatF=55.0
res2@mpMinLonF=70
res2@mpMaxLonF=135.0
res2@cnLinesOn=True
res2@cnFillOn = True
res2@cnLineLabelsOn=True
;res2@cnLevelSelectionMode="AutomaticLevels"
plot2=gsn_csm_contour_map(wks,avg_ano_lano,res2)
res3=True
res3@gsnAddCyclic=False
res3@gsnMaximize=True
res3@mpDataBaseVersion="MediumRes"
res3@mpDataSetName="Earth..4"
res3@mpOutlineOn=True
res3@mpFillOn = True
res3@mpOutlineSpecifiers=(/"China","Taiwan"/)
res3@mpGeophysicalLineThicknessF=2.0
res3@mpNationalLineThicknessF=2.0
res3@mpMinLatF=15.0
res3@mpMaxLatF=55.0
res3@mpMinLonF=70
res3@mpMaxLonF=135.0
res3@cnLinesOn=True
res3@cnFillOn = True
res3@cnLineLabelsOn=True
res3@cnLevelSelectionMode="ManualLevels"
res3@cnMinLevelValF = 5240
res3@cnMaxLevelValF = 5900
res3@cnLevelSpacingF = 40
plot3=gsn_csm_contour_map(wks,avg_hgt,res3)
res4=True
res4@gsnAddCyclic=False
res4@gsnMaximize=True
res4@mpDataBaseVersion="MediumRes"
res4@mpDataSetName="Earth..4"
res4@mpOutlineOn=True
res4@mpFillOn = True
res4@mpOutlineSpecifiers=(/"China","Taiwan"/)
res4@mpGeophysicalLineThicknessF=2.0
res4@mpNationalLineThicknessF=2.0
res4@mpMinLatF=15.0
res4@mpMaxLatF=55.0
res4@mpMinLonF=70
res4@mpMaxLonF=135.0
res4@cnLinesOn=True
res4@cnFillOn = True
res4@cnLineLabelsOn=True
plot4=gsn_csm_contour_map(wks,avg_ano_c,res4)
end
|
|