- 积分
- 26
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2023-4-15
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在绘图过程中一直报错uv2dv_cfd: the lat,lon arrays must be dimensioned nlat and nlon, the last two dimensions of u and v好像问题出在这里?
lat=in->latitude
lon=in->longitude
vapord=uv2dv_cfd(qu,qv,lat,lon,2) ; u,v ==> divergence
之前用ncep的数据绘制的时候是可以的,现在换成ERA5的数据后就一直报这个错,请教各位大佬该怎么处理呀?感激不尽!
源码:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
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/cnmap/cnmap.ncl"
begin
in = addfile("vapor-750_850.nc","r")
air1= short2flt(in->t(:,{850},:,:))
u1=short2flt(in->u(:,{850},:,:))
v1=short2flt(in->v(:,{850},:,:))
rhum1=short2flt(in->r(:,{850},:,:))
air = dim_avg_n_Wrap(air1, 0) ;求时间平均
uwnd = dim_avg_n_Wrap(u1, 0) ;求时间平均
vwnd = dim_avg_n_Wrap(v1, 0)
rhum = dim_avg_n_Wrap(rhum1, 0)
lat=in->latitude
lon=in->longitude
es=6.112*exp(17.67*air/(air+243.5))
qs=(622*es/(925-0.378*es))
q=qs*rhum/100
q= smth9(q, 0.50, -0.25, False)
qu = new((/73,144/),float)
qv = new((/73,144/),float)
do i=0,72
do j=0,143
qu(i,j) = q(i,j)*uwnd(i,j)/9.8
qv(i,j) = q(i,j)*vwnd(i,j)/9.8
end do
end do
; qu = smth9(qu, 0.50, -0.25, False)
; qv = smth9(qv, 0.50, -0.25, False)
vapord = new((/73,144/),float)
vapord=uv2dv_cfd(qu,qv,lat,lon,2) ; u,v ==> divergence
vapord = vapord*100000
copy_VarCoords(air,vapord)
printVarSummary(vapord)
wks = gsn_open_wks("png","vf")
vres = True ; plot mods desired
vres@gsnFrame = False ; so we can draw time stamp
vres@gsnDraw = False
vres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up
vres@vcRefMagnitudeF = 10.0 ; define vector ref mag
vres@vcRefLengthF = 0.045 ; define length of vec ref
vres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors
vres@vcMinDistanceF = 0.017
res = True
res@gsnFrame=False
res@gsnDraw=False
res@cnFillOn = True ; color on
res@cnLinesOn = False ; turn off contour lines
; res@gsnScalarContour = True ; vectors over contours
res@cnFillPalette = "sunshine_diff_12lev"
res@mpFillOn = False ; turn off map fill
res@cnFillPalette = "rh_19lev"
res@gsnContourNegLineDashPattern=1
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = -4 ; set min contour level
res@cnMaxLevelValF = 4 ; set max contour level
res@cnLevelSpacingF = 0.1 ; set contour spacing
res@mpMinLatF = 0
res@mpMaxLatF = 60
res@mpMinLonF =60
res@mpMaxLonF = 150
res@tiMainString ="Water vapor flux and its divergence during the event"
vfd = gsn_csm_contour_map(wks,vapord, res)
vf = gsn_csm_vector(wks, uwnd, vwnd, vres)
overlay(vfd,vf )
cnres = True
cnres@china = True ;draw china map or not
cnres@river = True ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = True ;draw nanhai or not
cnres@diqu = False ; draw diqujie or not
chinamap = add_china_map(wks,vfd,cnres)
gsn_panel(wks,vfd,(/1,1/),False)
frame (wks)
end
|
|