- 积分
- 13664
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大侠,我正在根据WRF输出结果画200、500、800和1000hpa的温度阴影图叠加位势高度等值线。
画的图如下所示:
画的横竖坐标轴经纬度坐标只显示网格索引,不显示经纬度坐标,而且位势高度等值线也不显示Label。
这个代码该如何改才能让它显示横竖轴经纬度和等值线的Label呢?谢谢!
代码如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
f = addfile ("/cygdrive/H/d03/wrfout_d03_2018-04-25_00_00_00", "r")
tc = wrf_user_getvar(f,"tc",1) ; temperature in degC
tc@units = "degC" ; better units
u = wrf_user_getvar(f,"ua",1) ; U component
u@units = "m/s"
v = wrf_user_getvar(f,"va",1) ; V component
v@units = "m/s"
gp = wrf_user_getvar(f,"geopt",1) ; Geopotential height
gp = gp/100
gp@units = "m2/s2"
p = wrf_user_getvar(f,"pressure",1) ; Geopotential height
p@units = "hpa"
hgt = wrf_user_getvar(f,"HGT",1) ; Geopotential height
hgt@units = "m"
printVarSummary(tc)
printVarSummary(u)
printVarSummary(v)
printVarSummary(p)
printVarSummary(gp)
gp_200=wrf_user_interp_level(gp,p,200,False)
gp_500=wrf_user_interp_level(gp,p,500,False)
gp_800=wrf_user_interp_level(gp,p,800,False)
gp_1000=wrf_user_interp_level(gp,p,1000,False)
tc_200=wrf_user_interp_level(tc,p,200,False)
tc_500=wrf_user_interp_level(tc,p,500,False)
tc_800=wrf_user_interp_level(tc,p,800,False)
tc_1000=wrf_user_interp_level(tc,p,1000,False)
wks = gsn_open_wks("x11" ,"panel1c")
res = True ; Plot options desired
res@gsnDraw = False ; Don't draw plots
res@gsnFrame = False ; Don't advance frames
res = wrf_map_resources(f,res) ; Add necessary resources for WRF map
res@tfDoNDCOverlay = True ; Use the native WRF map projection
res@gsnAddCyclic = False ; Don't add longitude cyclic point
res@cnFillOn = True ; Turn on color
res@lbOrientation = "Vertical" ; Vertical labelbar
res@cnLevelSelectionMode = "AutomaticLevels" ; Set contour levels
res@cnLinesOn = False ; Turn off contour lines
res@cnLineLabelsOn = False ; Turn off contour labels
res@cnFillOn = True ; Turn on contour fill
res@gsnRightString = " " ;-- turn off right string92
res@gsnLeftString = " " ;-- turn off left string
pres = True
pres@gsnDraw = False
pres@gsnFrame = False
pres = wrf_map_resources(f,pres)
; pres@cnFillon = False
pres@cnLinesOn = True ; Turn on contour lines
pres@cnLineLabelsOn = True ; Turn on contour labels
pres@cnLineColor = "Black"
pres@gsnRightString = " " ;-- turn off right string92
pres@gsnLeftString = " " ;-- turn off left string
pres@tmXBMode = "Explicit"
pres@tmXBValues = res@tmXBValues
pres@tmYLMode = "Explicit"
pres@tmYLValues = res@tmYLValues
;
; Loop across four levels and create a contour plot for each one.
; Change the main title each time.
;
plots = new(4,graphic)
tplot = new(4,graphic)
do i=0,3
if (i.eq.0) then
res@tiMainString = "200hpa"
pplot(i) = gsn_csm_contour(wks,gp_200,pres)
tplot(i) = gsn_csm_contour(wks,tc_200,res)
mm=62
else if (i.eq.1) then
res@tiMainString = "500hpa"
pplot(i) = gsn_csm_contour(wks,gp_500,pres)
tplot(i) = gsn_csm_contour(wks,tc_500,res)
mm=55
else if (i.eq.2) then
res@tiMainString = "800hpa"
pplot(i) = gsn_csm_contour(wks,gp_800,pres)
tplot(i) = gsn_csm_contour(wks,tc_800,res)
mm=40
else
res@tiMainString = "1000hpa"
pplot(i) = gsn_csm_contour(wks,gp_1000,pres)
tplot(i) = gsn_csm_contour(wks,tc_1000,res)
mm=0
end if
end if
end if
overlay(tplot(i),pplot(i))
end do
;---Create a panel of plots with 2 rows and 2 columns.
gsn_panel(wks,tplot,(/2,2/),False)
|
-
温度阴影叠加位势高度等值线
|