- 积分
- 3300
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-5-5
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
就是想画一下时间高度剖面图,用的数据是wrf出来的,然后分别对温度和位涡进行区域平均之后画图。但是最后结果全是缺测值是怎么回事。。因为我插值的问题吗??
代码如下:
begin
f = addfile("f:/wrfdata/chanchu_18km.nc","r")
res =True
res@NoTitles =True
;经纬度转换
Lat =new((/171/), float)
Long =new((/144/), float)
LAT =f->XLAT
LONG =f->XLONG
Lat =LAT(1,:,1)
Long =LONG(1,2,:)
Lat@unit ="degree_north"
Long@unit ="degree_east"
;时间转换
time =f->Times
Times_s =chartostring(time)
z =wrf_user_getvar(f, "z",-1)
T =wrf_user_getvar(f, "tc",-1)
pvo =wrf_user_getvar(f, "pvo", -1)
T!0 ="Times"
T!2 ="Lat"
T!3 ="Long"
T&Times =Times_s
T&Lat =Lat
T&Long =Long
pvo!0 ="Times"
pvo!2 ="Lat"
pvo!3 ="Long"
pvo&Lat =Lat
pvo&Long =Long
pvo&Times =Times_s
H =(/0,2000,4000,6000,8000,10000,12000,14000,16000,18000,20000/)
T_Plane =wrf_user_vert_interp(f, T, "ght_msl", H, True)
pvo_plane =wrf_user_vert_interp(f, pvo, "ght_msl", H, True)
T_Plane!1 ="height"
T_Plane&height =H
pvo_plane!1 ="height"
pvo_plane&height =H
dT=new((/63,11,171,144/), float)
do i =0,62,1
dT(i,:,:,:)=T_Plane(i,:,:,:)-T_Plane(0,:,:,:)
end do
temp =new((/57,11,171,144/),float)
temp =dT(6:62,:,:,:);模式区域取了任意一个加权来计算
copy_VarCoords(T_Plane(6:62,:,:,:), temp(:,:,:,:))
T_area =wgt_areaave(temp(:,:,85:86,77:78), 1.0,1.0,1)
;计算区域涡度值
;copy_VarCoords(pvo_plane(6:62,:,:,:), Varea1)
Varea1 =new((/57,11,171,144/), float)
Varea1 =pvo_plane(6:62,:,:,:)
copy_VarCoords(pvo_plane(6:62,:,:,:), Varea1)
Varea2 =wgt_areaave(Varea1(:,:,80:90,72:82), 1.0,1.0,1)
Varea2!0 ="Times"
Varea2!1 ="height"
T_area!0 ="Times"
T_area!1 ="height";这里的维度命名没成功
wks =gsn_open_wks("png", "T_Pvo")
;gsn_define_colormap(wks, "")
opt_xy =True
opt_xy@tiYAxisString ="Hight(km)"
opt_xy@cnMissingValPerimOn =False
;opt_xy@cnMissingValFillColor =0
;opt_xy@cnMissingValFillPattern =11
opt_xy@tmYLValues =(/0,2000,4000,6000,8000,10000,12000,14000,16000,18000,20000/)
opt_xy@tmYLLabels =(/0,2,4,6,8,10,12,14,16,18,20/)
opt_xy@tmXBMode ="Explicit"
opt_xy@tmXBValues =ispan(0,56, 8)
opt_xy@tmXBLabels =(/"1100","1200","1300","1400","1500","1600","1700","1800"/)
opt_xy@tiMainOn =False
opt_xy@lbTitleOn =False
;温度
resT =opt_xy
resT@cnFillOn =True
resT@cnLinesOn =False
resT@cnLevelSelectionMode ="ExplicitLevels"
;resT@cnLevels =(/-4,-2,-1,1,2,3,4,6,8,12/)
resT@ContourParameters =4
resT@lbLabelBarOn =True
resT@lbOrientation ="Horizontal"
resT@pmLabelBarSide ="Right"
resT@lbLabelFontHeightF =0.01
resT@lbLabelFontColor ="black"
contour_T =wrf_contour(f, wks, T_area, resT)
;涡度
resV =opt_xy
resV@cnLinesOn =True
resV@cnLevel =(/2/)
resV@cnLineColor ="brown"
resV@cnLineDashPattern =2
resV@cnLineThicknesses =0.3
contour_V =wrf_contour(f, wks,Varea2, resV)
plot=wrf_overlays(f, wks,(/contour_T,contour_V/), res)
最后发现 Varea2和T_area都成了缺测值。。。。不知道哪错了,求大神讲解
|
|