- 积分
- 1831
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-6
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
|
问题概况: |
垂直剖面dbz与vector叠加,无法更改dbz坐标属性。
做vector剖面与dbz叠加后,发现dBz色标有问题,在res中无法修改。于是将vector与tc叠加(tc等值线设成白色),另附dbz属性,想用wrf_overlays把dBz叠加到vector上,但dBz不显示。系统报错
warning:ContourParameters is not a valid resource in plt_CrossSection_vector_contour at this time
warning:Footer is not a valid resource in plt_CrossSection_vector_contour at this time
warning:NhlGetValues:Error retrieving tiMainString
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 4493 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 121 in file cross_section_vector.ncl |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
1 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
附上脚本,如图,dbz色标有问题,想更改色标,谢谢!
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
a=addfile("/home/zssapr/WRF3.5.1/20110710/WRFV3/test/em_real/wrfout_d02_2011-07-05_00:00:00.nc","r")
; We generate plots, but what kind do we prefer?
type = "x11"
; type = "pdf"
; type = "ps"
; type = "ncgm"
wks = gsn_open_wks(type,"plt_CrossSection_vector")
gsn_define_colormap(wks,"wh-bl-gr-ye-re")
; Set some basic resources
res = True
;res@MainTitle = "REAL-TIME WRF"
res@Footer = False
pltres = True
ter_res = True
opts_ter = ter_res
opts_ter@gsnYRefLine = 0.0
opts_ter@gsnAboveYRefLineColor = "black"
opts_ter@gsnDraw = False
opts_ter@gsnFrame = False
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mdims = getfilevardimsizes(a,"P") ; get some dimension sizes for the file
nd = dimsizes(mdims)
;---------------------------------------------------------------
ter = wrf_user_getvar(a,"ter",0)
xlon = wrf_user_getvar(a, "XLONG",0)
it=161
tc = wrf_user_getvar(a,"tc",it) ; T in C
rh = wrf_user_getvar(a,"rh",it) ; relative humidity
z = wrf_user_getvar(a, "z",it) ; grid point height
dBz =wrf_user_getvar(a,"dbz", it)
U = wrf_user_getvar(a,"U",it) ; U wind
V = wrf_user_getvar(a,"V",it) ; V wind
W :=wrf_user_getvar(a,"W", it) ;vertical wind
p = wrf_user_getvar(a, "pressure",it)
ua =wrf_user_unstagger(U,U@stagger)
va =wrf_user_unstagger(V,V@stagger)
wa :=wrf_user_unstagger(W,W@stagger)
plane = (/ mdims(nd-1)/2, mdims(nd-2)/2 /) ; pivot point is center of domain (x,y)
angle=45
opts = False
ua_plane = wrf_user_intrp3d(ua,p,"v",plane,angle,opts)
va_plane = wrf_user_intrp3d(va,p,"v",plane,angle,opts)
w_plane =wrf_user_intrp3d(wa,p,"v",plane,angle,opts)
rh_plane = wrf_user_intrp3d(rh,p,"v",plane,angle,opts)
dBz_plane = wrf_user_intrp3d(dBz,p,"v",plane,angle,opts)
tc_plane = wrf_user_intrp3d(tc,p,"v",plane,angle,opts)
p_plane = wrf_user_intrp3d(p, p,"v",plane, angle,opts)
ter_plane = wrf_user_intrp2d(ter,plane,angle,opts)
X_plane = wrf_user_intrp2d(xlon,plane,angle,opts)
wAve = avg(w_plane(:,:)) ; used for scaling
vAve = avg(va_plane(:,:))
scale = fabs(vAve/wAve)
wscale = w_plane*scale ; now scale
tc_plane!0="level"
tc_plane&level = p_plane(:, 0)
copy_VarCoords(tc_plane, va_plane)
copy_VarCoords(tc_plane, wscale)
;printVarSummary(p_plane)
;print(p_plane(:,0))
dBz_plane!0="level"
dBz_plane&level = p_plane(:, 0)
copy_VarCoords(dBz_plane, va_plane)
copy_VarCoords(dBz_plane, wscale)
;***********************************************
; create plot
;***********************************************
res = True ; plot mods desired
res@tiMainString = "Pressure/Height Vector" ; title
res@tiYAxisString = "Pressure (mb)"
res@cnLineLabelsOn = False ; turn off line labels
res@cnFillOn = False ; turn on color fill
res@cnLineColor = "white"
res@lbLabelStride = 2 ; every other color
;res@ContourParameters = (/ 0., 50., 2. /)
res@gsnSpreadColors = True ; use full range of color map
res@cnMissingValPerimOn = True
res@cnMissingValFillColor = 0
res@cnMissingValFillPattern = 11
res@tmYLMode = "Explicit"
res@gsnSpreadColors = True ; use full range of color map
res@vcRefMagnitudeF = 3.0 ; define vector ref mag
res@vcRefLengthF = 0.045 ; define length of vec ref
res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
res@vcMinDistanceF = 0.03 ; thin out vectors
res@vcMapDirection = False
plot_vector = gsn_csm_pres_hgt_vector(wks,tc_plane(2:,:),va_plane(2:,:),wscale(2:,:),res )
;**************************************************
;dBz plot
; opts_dBz=True
; opts_dBz@cnFillOn = True ; turn on color fill
; opts_dBz@lbLabelStride = 2 ; every other color
; opts_dBz@ContourParameters = (/ 0., 50., 2. /)
; opts_dBz@cnMissingValFillColor = 0
; opts_dBz@cnMissingValFillPattern = 11
; opts_dBz@gsnDraw = False
; opts_dBz@gsnFrame = False
; contour_dBz = wrf_contour(a,wks,dBz_plane(2:,:),opts_dBz)
; plot = wrf_overlays(a,wks,(/plot_vector,contour_dBz/),True)
end
|
|