- 积分
- 37
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-10-23
- 最后登录
- 1970-1-1
![未绑定新浪微博用户 新浪微博达人勋](source/plugin/sina_login/img/gray.png)
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
亲们,我想画850hpa风场,用wrf_user_intrp3d这个函数提示错误,下面是我的脚本,
;*************************************************
;
;************************************************
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/wrf/WRFUserARW.ncl" ; Add special wrf functions
;************************************************
begin
;************************************************
; open file and read in data
;************************************************
; a = addfile("./wrfchemi_12z_d02.nc","r")
; a = addfile("./wrfinput_d01.nc","r")
a = addfile("./wrfout_d02_2014-01-06_12:00:00.nc","r")
;************************************************
; create plot
;************************************************
; type = "x11"
type = "pdf"
wks = gsn_open_wks(type ,"wrf-out-PM10") ; open a ps file
gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
; gsn_define_colormap(wks,"CBR_wet") ; choose colormap
pltres = True ; Set plot options
mpres = True ; Set map options
mpres@mpGridAndLimbOn = True
mpres@mpGridLineDashPattern = 2.
mpres@mpGridLatSpacingF = 5.
mpres@mpGridLonSpacingF = 5.
mpres@mpGeophysicalLineColor = "Black"
mpres@mpGeophysicalLineThicknessF = 2
mpres@mpNationalLineColor = "Black"
mpres@mpNationalLineThicknessF = 2
mpres@mpGridLineColor = "Black"
mpres@mpGridLineThicknessF = 2
mpres@mpLimbLineColor = "Black"
mpres@mpLimbLineThicknessF = 2
mpres@mpPerimLineColor = "Black"
mpres@mpPerimLineThicknessF = 2
mpres@mpUSStateLineColor = "Black"
mpres@mpUSStateLineThicknessF = 2
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpDataSetName = "Earth..4"
mpres@mpOutlineSpecifiers = (/"China:states"/)
mpres@tfDoNDCOverlay = True
res = True
res@MainTitle = "WRF-chem PM10"
res@Footer = False
;times = wrf_user_list_times(a) ; get times in the file
times = wrf_user_getvar(a,"Times",-1)
ntimes = dimsizes(times(:,0)) ; number of times in the file
do it=0,ntimes-1,1
print("Working on time: " + times(it,:) )
res@TimeLabel = times(it,:) ; Set Valid time to use on plots
ter= wrf_user_getvar(a,"PM2_5_DRY",it)
u = wrf_user_getvar(a,"U",it) ; u averaged to mass points
v = wrf_user_getvar(a,"V",it) ; v averaged to mass points
pa = wrf_user_getvar(a, "P",it) ; pressure
pb = wrf_user_getvar(a, "PB",it) ; pressure
p=pa+pb
u_plane(0,:,:) = wrf_user_intrp3d(u,p,"h",850.,0.,False)
v_plane(0,:,:) = wrf_user_intrp3d(v,p,"h",850.,0.,False)
spd = (u_plane*u_plane + v_plane*v_plane)^(0.5) ; m/sec
spd@description = "Wind Speed"
spd@units = "m/s"
u_plane = u_plane*1.94386 ; kts
v_plane = v_plane*1.94386 ; kts
u_plane@units = "kts"
v_plane@units = "kts"
; Plotting options for PM10
opts = res
opts@cnFillOn = True ; turn on color fill
opts@ContourParameters = (/ 40., 300., 20. /) ; Set the levels
contour = wrf_contour(a,wks,ter(0,:,:),opts)
delete(opts)
; Plotting options for Wind Vectors
opts = res
opts@FieldTitle = "850hpa Wind"
opts@NumVectors = 50
opts@vcGlyphStyle = "FillArrow" ; select wind barbs
opts@vcMinDistanceF =0.03 ;int
opts@vcRefMagnitudeF =20.
opts@vcRefLengthF = 0.02
opts@vcMinFracLengthF = 0.2
vector = wrf_vector(a,wks,u_plane,v_plane,opts)
delete(opts)
;plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
plot = wrf_map_overlays(a,wks,(/contour,vector/),pltres,mpres)
;************************************************
end do
end
提示的错误fatal:Dimension size mismatch, dimension (2) of left hand side reference does not have the same size as the right hand side reference after subscripting.
fatal:Execute: Error occurred at or near line 277 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
我的u,v风场选定了时间,应该都是三维的啊,差值到850hp应该是两维的,不知道为什么提示维数错误,求大神指点
|
|