- 积分
- 9362
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-5-10
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
f1 = addfile("/Users/xueyuxiaodan/Desktop/data/fnl/fnl_20150102_06_00.grib2", "r")
f2 = addfile("/Users/xueyuxiaodan/Desktop/data/fnl/fnl_20160119_12_00.grib2", "r")
f3 = addfile("/Users/xueyuxiaodan/Desktop/data/fnl/fnl_20190125_18_00.grib2", "r")
; ncl_filedump
lats1=15
lats2=40
lons1=65
lons2=105
hgt=50000
rh1= f1->RH_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
tk1 = f1->TMP_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
u1 = f1->UGRD_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
v1 = f1->VGRD_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
rh2= f2->RH_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
tk2 = f2->TMP_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
u2 = f2->UGRD_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
v2 = f2->VGRD_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
rh3= f3->RH_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
tk3 = f3->TMP_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
u3 = f3->UGRD_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
v3 = f3->VGRD_P0_L100_GLL0({hgt},{lats1:lats2},{lons1:lons2})
e1=6.112*exp(17.67*(tk1-273.15)/(tk1-29.65))
; copy_VarCoords(tk1,e1)
qs1=0.622*e1/(1000-0.378*e1)
; copy_VarCoords(tk1,qs1)
q1=qs1*rh1/100
; copy_VarCoords(tk1,q1)
U1=q1*u1
; copy_VarCoords(tk1,U1)
V1=q1*v1
; copy_VarCoords(tk1,V1)
qdiv1 =uv2dvG_Wrap(U1,V1)*100000000
; qdiv1=1/9.8*uv2dv_cfd(U1,V1,lat,lon,2)*100000000
; copy_VarCoords(tk1,qdiv1)
e2=6.112*exp(17.67*(tk2-273.15)/(tk2-29.65))
; copy_VarCoords(tk2,e2)
qs2=0.622*e2/(1000-0.378*e2)
; copy_VarCoords(tk2,qs2)
q2=qs2*rh2/100
; copy_VarCoords(tk2,q2)
U2=q2*u2
; copy_VarCoords(tk2,U2)
V2=q2*v2
; copy_VarCoords(tk2,V2)
qdiv2 = uv2dvG_Wrap(U2,V2)*100000000
; qdiv2=1/9.8*uv2dv_cfd(U2,V2,lat,lon,2)*100000000
; copy_VarCoords(tk2,qdiv2)
e3=6.112*exp(17.67*(tk3-273.15)/(tk3-29.65))
; copy_VarCoords(tk3,e3)
qs3=0.622*e3/(1000-0.378*e3)
; copy_VarCoords(tk3,qs3)
q3=qs3*rh3/100
; copy_VarCoords(tk3,q3)
U3=q3*u3
; copy_VarCoords(tk3,U3)
V3=q3*v3
; copy_VarCoords(tk3,V3)
qdiv3 = uv2dvG_Wrap(U3,V3)*100000000;不能有缺失
; qdiv3=1/9.8*uv2dv_cfd(U3,V3,lat,lon,2)*100000000
copy_VarCoords(tk3,qdiv3)
speed1=sqrt(U1^2+V1^2)*1000
; copy_VarCoords(tk3,speed1)
speed2=sqrt(U2^2+V2^2)*1000
; copy_VarCoords(tk3,speed2)
speed3=sqrt(U3^2+V3^2)*1000
; copy_VarCoords(tk3,speed3)
wks = gsn_open_wks("eps","tu4-2121")
; gsn_define_colormap(wks, "temp_diff_18lev")
gsn_define_colormap(wks, "MPL_ocean")
; gsn_reverse_colormap(wks,"CBR_wet")
res=True
res@gsnFrame = False ;画在一张图上,图像输出关
res@gsnDraw = False ;不画中间图,图像输出关
; res@gsnMaximize = True
res@gsnLeftString = ""
res@gsnRightString = ""
; ; ;平滑
res@cnSmoothingOn = True
res@cnSmoothingDistanceF = 0.002
res@cnSmoothingTensionF = True
cnres=res
cnres@cnFillOn = False ;不画彩色图
cnres@cnLinesOn = True ;画等直线
cnres@cnLineLabelsOn = True ;不画等值线的标签
cnres@cnInfoLabelOn=False ;等值线框
cnres@cnLineLabelFontHeightF=0.014;标签字体大小
cnres@cnLevelSelectionMode = "ManualLevels" ;颜色与数据对应
cnres@cnMinLevelValF = 0 ; 等值线最小值
cnres@cnMaxLevelValF = 20 ; 等值线最大值
cnres@cnLevelSpacingF = 4 ; 控制等值线间隔
; resc@cnLevelSelectionMode = "AutomaticLevels"
; resc@cnLevelSpacingF = 15.
res@mpOutlineOn =True;显示海陆分布线
res@mpFillOn=False ;陆地不填充
res@pmTickMarkDisplayMode = "Always" ;画度数
res@gsnAddCyclic= False
res@mpMinLatF =20
res@mpMaxLatF = 36
res@mpMinLonF = 70
res@mpMaxLonF = 100
res@cnFillOn = True ;画彩色图
res@cnLinesOn = False ;不画等直线
res@cnLineLabelsOn = False ;不画等值线的标签
res@cnLevelSelectionMode = "ManualLevels" ;颜色与数据对应
res@cnMinLevelValF = -3 ; 等值线最小值
res@cnMaxLevelValF = 0 ; 等值线最大值
res@cnLevelSpacingF = 4 ; 控制等值线间隔
plot = new(3,graphic)
cnplot = new(3,graphic)
plot(0)= gsn_csm_contour_map(wks,qdiv1,res)
plot(1)= gsn_csm_contour_map(wks,qdiv2,res)
plot(2)= gsn_csm_contour_map(wks,qdiv3,res)
cnplot(0) = gsn_csm_contour(wks,speed1,cnres)
cnplot(1) = gsn_csm_contour(wks,speed2,cnres)
cnplot(2) = gsn_csm_contour(wks,speed3,cnres)
overlay(plot(0),cnplot(0))
overlay(plot(1),cnplot(1))
overlay(plot(2),cnplot(2))
pres = True
pres@gsnPanelFigureStrings = (/"a","b","c"/)
pres@amJust = "TopLeft" ;; 调整标签的位置
res@gsnPanelRowSpec = True
gsn_panel(wks,(/plot/),(/2,2/),pres)
gsn_panel(wks,(/cnplot/),(/2,2/),pres)
draw(plot)
; draw(map)
frame(wks)
错误报如下:
(0) check_for_y_lat_coord: Warning: Data either does not contain (0) a valid latitude coordinate array or doesn't contain one at all. (0) A valid latitude coordinate array should have a 'units' (0) attribute equal to one of the following values: (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north' (0) check_for_lon_coord: Warning: Data either does not contain (0) a valid longitude coordinate array or doesn't contain one at all. (0) A valid longitude coordinate array should have a 'units' (0) attribute equal to one of the following values: (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east' (0) check_for_y_lat_coord: Warning: Data either does not contain (0) a valid latitude coordinate array or doesn't contain one at all. (0) A valid latitude coordinate array should have a 'units' (0) attribute equal to one of the following values: (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north' (0) check_for_lon_coord: Warning: Data either does not contain (0) a valid longitude coordinate array or doesn't contain one at all. (0) A valid longitude coordinate array should have a 'units' (0) attribute equal to one of the following values: (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east' warning:ContourPlotSetValues: attempt to set overlay member plot view ignored warning:ContourPlotSetValues: attempt to set overlay member plot view ignored warning:ContourPlotSetValues: attempt to set overlay member plot view ignored warning:NhlDraw: cannot draw Plot Member, ID 176, independently warning:NhlDraw: cannot draw Plot Member, ID 204, independently warning:NhlDraw: cannot draw Plot Member, ID 232, independently |
|