- 积分
- 1095
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-3
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 SG哭晕在厕所 于 2017-10-12 07:54 编辑
运行之后出现以下报错,一头雾水。。。想对照着改都没法改
warning:ContourPlotInitialize: scalar field is constant; no contour lines will appear; use cnConstFEnableFill to enable fill
fatal:_NhlGetEndpointsAndStepSize: Max value less than or equal to min value
fatal:ContourPlotInitialize: error choosing spacing
fatal:ContourPlotInitialize: error getting contour level information
fatal:ContourPlotInitialize: error initializing dynamic arrays
fatal:Unable to initialize layer-Can't Create
fatal:Unable to access object with id:-4
fatal:PID #-4 can't be found in NhlSetValues
fatal:NhlGetValues:PID #-4 is invalid
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1425 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1468 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1560 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 10122 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3927 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":8575]:Execute: Error occurred at or near line 77 in file K.ncl
以下是脚本
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
a = addfile("wrfchem1/WRFV3/test/em_real/wrfout_d02_2016-11-04_11:00:00","r")
type = "png"
wks = gsn_open_wks(type,"k")
times= wrf_user_list_times(a); get times in the file
ntimes = dimsizes(times) ; number of times in the file
tc = wrf_user_getvar(a,"tc",-1) ; T in C
u= wrf_user_getvar(a,"ua",-1) ; u averaged to mass points
v= wrf_user_getvar(a,"va",-1) ; v averaged to mass points
p= wrf_user_getvar(a, "pressure",-1) ;
rh = wrf_user_getvar(a,"rh",-1) ; relative humidity;
z = wrf_user_getvar(a, "z",-1) ; grid point height
sandu = uv2dvG (u,v)
pressure_levels = (/ 925.,850.,700.,500.,200./) ; pressure levels to plot
nlevels = dimsizes(pressure_levels) ; number of pressure levels
tc_plane = wrf_user_intrp3d(tc,p,"h",pressure_levels,0.,False)
z_plane= wrf_user_intrp3d( z,p,"h",pressure_levels,0.,False)
rh_plane = wrf_user_intrp3d(rh,p,"h",pressure_levels,0.,False)
u_plane= wrf_user_intrp3d( u,p,"h",pressure_levels,0.,False)
v_plane= wrf_user_intrp3d( v,p,"h",pressure_levels,0.,False)
p_plane= wrf_user_intrp3d( p,p,"h",pressure_levels,0.,False)
T850=tc_plane(0,1,:,:)
rh1 = rh_plane(0,1,:,:)
Td850=T850-((14.55+0.114*T850)*(1-0.01*rh1) + exp((2.5+0.007*T850)*(1-0.01*rh1))^exp(3) + (15.9+0.117*T850)*exp(1-0.01*rh1)^exp(14))
T700=tc_plane(0,2,:,:)
rh2 = rh_plane(0,2,:,:)
Td700=T700-((14.55+0.114*T700)*(1-0.01*rh2) + exp((2.5+0.007*T700)*(1-0.01*rh2))^exp(3) + (15.9+0.117*T700)*exp(1-0.01*rh2)^exp(14))
T500=tc_plane(0,3,:,:)
K=T850-T500+Td850-(T700-Td700)
res = True ; Variable to hold plot options
res@gsnDraw = False
res@gsnFrame = False
res@gsnAddCyclic = False
res@mpOutlineOn = True
res@cnFillOn = False ; Turn on contour fill.
res@cnLinesOn = True
res@cnLineLabelsOn = False
; res@cnLevelSelectionMode = "ManualLevels" ; manually select levels
; res@cnLevelSpacingF = 1000 ; contour spacing
; res@cnMinLevelValF = 95000 ; min level
; res@cnMaxLevelValF = 103000 ; max leve
; res@lbOrientation = "Vertical" ; Move labelbar to side.
res@gsnMajorLatSpacing = 3
res@gsnMajorLonSpacing = 3
res@mpGeophysicalLineThicknessF = 3.
res@mpProvincialLineThicknessF = 3.
res@pmTickMarkDisplayMode = "Always"
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpOutlineSpecifiers = (/"China:states"/)
res@mpLandFillColor = 0
res@lbLabelBarOn = False
res@mpLimitMode = "Latlon"
res@mpMinLatF = 19
res@mpMaxLatF = 54
res@mpMinLonF = 98
res@mpMaxLonF = 127
res@cnFillDrawOrder = "PreDraw"
res@mpOceanFillColor = 0
res@mpInlandWaterFillColor = 0
plot = wrf_contour(a,wks,K(:,:),res)
end |
|