- 积分
- 9177
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大侠,本人刚学ncl,想请教问题,下面附上脚本:
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"
printVarSummary(tc)
printVarSummary(u)
printVarSummary(v)
wks = gsn_open_wks("x11" ,"panel1c") ; Open png file "panel1c.png"
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 = "ManualLevels" ; Set contour levels
;res@cnMinLevelValF = 8
;res@cnMaxLevelValF = 38
;res@cnLevelSpacingF = 2
res@cnLevelSelectionMode = "AutomaticLevels" ; Set contour levels
; res@cnFillMode = "RasterFill"
res@cnLinesOn = False ; Turn off contour lines
res@cnLineLabelsOn = False ; Turn off contour labels
res@cnFillOn = True ; Turn on contour fill
vcres = True ;-- vector only resources
vcres@gsnDraw = False ;-- don't draw
vcres@gsnFrame = False ;-- don't advance frame
vcres@vcGlyphStyle = "WindBarb" ;-- curly vectors
vcres@vcRefMagnitudeF = 20 ;-- define vector ref mag
vcres@vcRefLengthF = 0.045 ;-- define length of vec ref
;vcres@vcRefAnnoOrthogonalPosF = -.535 ;-- move ref vector into plot
vcres@gsnRightString = " " ;-- turn off right string92
vcres@gsnLeftString = " " ;-- turn off left string
vcres@tiXAxisString = " " ;-- turn off axis label
vcres@vcLevelSelectionMode = "ManualLevels"
vcres@vcLevelSpacingF = 50
vcres@vcMinDistanceF=0.03
;
; Loop across four levels and create a contour plot for each one.
; Change the main title each time.
;
plots = new(4,graphic)
vplot = new(4,graphic)
do i=0,3
if (i.eq.0) then
res@tiMainString = "220hpa"
mm=62
else if (i.eq.1) then
res@tiMainString = "500hpa"
mm=55
else if (i.eq.2) then
res@tiMainString = "800hpa"
mm=40
else
res@tiMainString = "1000hpa"
mm=0
end if
end if
end if
; plots(i) = gsn_csm_contour_map(wks,tc(0,mm,:,:),res)
plots(i) = gsn_csm_contour_map(wks,tc(mm,:,:),res)
vplot(i) = gsn_csm_vector(wks,u(mm,:,:),v(mm,:,:),vcres)
overlay(plots(i),vplot(i))
end do
;---Create a panel of plots with 2 rows and 2 columns.
gsn_panel(wks,plots,(/2,2/),False)
得到的图如下:
但是这个风场太稀疏了,而且箭头还有重叠。
我把温度数据忽略不画,然后把上面脚本的风场vplot全部输出了一下,得到下图:
这说明风场vplot的数据不是那么像上图一样稀疏的,只是温度plot和风场vplot的overlay之后才造成风场特别稀疏,这是为什么?我怎么改才能让温度场正常叠加风场?谢谢!
|
-
温度风场图
-
单纯风场图
|