- 积分
- 1424
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-14
- 最后登录
- 1970-1-1
|
发表于 2017-7-24 15:43:47
|
显示全部楼层
我的脚本如下
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/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;********************************************
begin
a = addfile("wrfout_d01_2015-08-08_12_00_00","r")
t = wrf_user_getvar(a,"rh",0)
p = wrf_user_getvar(a,"pressure",0)
;p=(/1000,850,700,600,500,400,300,250,200,150,100,70,50,30,10/)
;printVarSummary(p)
lon= wrf_user_getvar(a,"XLONG",0)
; Plot a cross session that run from point A to point B
loc1 = wrf_user_latlon_to_ij(a,26,116)
loc2 = wrf_user_latlon_to_ij(a,26,124)
plane = new(4,float)
plane=(/loc1(1),loc2(1), loc1(0),loc2(0)/) ; start x;y & end x;y point
t_plane = wrf_user_intrp3d(t,p,"v",plane,90.,True)
;printVarSummary(t_plane)
p_plane = wrf_user_intrp3d(p,p,"v",plane,90.,True)
;printVarSummary(p_plane)
lon_plane = wrf_user_intrp2d(lon,plane,90.,True)
; printVarSummary(lon_plane)
t_plane!0="level"
t_plane&level =p_plane(:,0)
;t_plane&level = (/1000,850,700,600,500,400,300,250,200,150,100,70,50,30,10/)
t_plane&level@units="hPa"
t_plane!1="lon"
t_plane&lon = lon_plane
t_plane@units="C"
printVarSummary(t_plane)
; ===========================
wks = gsn_open_wks ("png", "ctl-vertical-temp" ) ; open workstation
res =True
res@tiMainString = "Temperature at vertical levels" ; title
res@cnLevelSelectionMode = "ManualLevels" ; manual contour levels
res@cnLevelSpacingF = 10 ; contour interval
res@cnMinLevelValF = 200. ; min level
res@cnMaxLevelValF = 350. ; max level
res@cnLineLabelsOn = True ; turn on line labels
res@cnFillOn = True ; turn on color fill
res@cnFillPalette = "BlWhRe" ; set color map
; Options for XY Plots
res@tiYAxisString = "Level(hPa)"
;res@cnMissingValPerimOn = True
res@cnMissingValFillColor = 0
res@cnMissingValFillPattern = 11
res@tmYLMode = "Explicit"
;res@tmYLValues = fspan(100,1000,100) ; Create tick marks
res@tmYLLabels = (/"1000","850","700","600","500","400","300","250","200","150","100","70","50","30","10"/)
res@tmXBMode = "Explicit"
res@tmXBValues = fspan(116,124,5)
res@tmXBLabels = (/"116","118","120","122","124"/)
;if(any(ismissing(t_plane))) then
;print("Your data is all missing. Cannot create plot.")
; else
plot = gsn_csm_pres_hgt(wks,t_plane,res)
;end if
end
结果出错,显示:
fatal:The result of the conditional expression yields a missing value. NCL can not determine branch, see ismissing function
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 12154 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 59 in file ctl-div-cross.ncl
59行是plot = gsn_csm_pres_hgt(wks,t_plane,res)
你知道什么原因吗 |
|