- 积分
- 3544
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-9-29
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 zxholystar 于 2016-11-18 12:31 编辑
NCL画4000米的数据时显示可以读取数据,但是就是不出图,程序也不停止,画8000m数据时直接就报错了,有大神帮忙看一下嘛?谢谢
画8000m数据时报的错:Read inputfile /home/zx/test/uvwtrh/Blend_8000m_201611120600.nc successfully!
fatal:_NhlGetEndpointsAndStepSize: Max value less than or equal to min value
fatal:VectorPlotInitialize: error choosing spacing
fatal:VectorPlotInitialize: error getting vector level information
fatal:VectorPlotInitialize: error initializing dynamic arrays
fatal:Unable to initialize layer-Can't Create
fatal:Unable to access object with id:-4
fatal:_NhlDataUpdate:called for a non-DataComm class
fatal:PID #-4 can't be found in NhlSetValues
fatal:NhlGetValues:PID #-4 is invalid
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 2806 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 10916 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 12432 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 126 in file /home/zx/test/uvwtrh/draw.ncl
shell脚本:
#!/bin/bash
source ~/.bashrc
export WORKDIR=/home/zx/test/uvwtrh
export PRODUCTDIR=/home/zx/test/uvwtrh/products
#ncl 'params="src=/home/zx/test/uvwtrh/uvwtrh_100m_2016111200.nc"' $WORKDIR/draw.ncl
ncl 'params="src=/home/zx/test/uvwtrh/Blend_4000m_201611120600.nc"' $WORKDIR/draw.ncl
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/csm/contributed.ncl"
load "$WORKDIR/include/library.ncl"
begin
;坐标属性
undef ("setProperty")
procedure setProperty(olon, olat)
begin
olon!0 = "lon"
olon@long_name = "lon"
olon@units = "degrees-east"
olon&lon = olon
olat!0 = "lat"
olat@long_name = "lat"
olat@units = "degrees_north"
olat&lat = olat
end
;数据赋坐标
undef ("setCoordinate")
procedure setCoordinate(data,lon1,lat1)
begin
data!0 = "lat"
data&lat = lat1
data!1 = "lon"
data&lon = lon1
end
inputDir = getArgsPara(params,"src")
if( .not. isfilepresent(inputDir))then
myPrint("Inputfile "+inputDir+" does not exit!")
return -1
end if
data = addfile(inputDir,"r")
myPrint("Read inputfile "+inputDir+" successfully!")
if (.not.isfilevar(data, "UGRD")) then
myPrint("Variable U100 does not exist!")
return -1
end if
u_wind= data->UGRD
u_wind@_fillvalue="_"
if (.not.isfilevar(data, "VGRD")) then
myPrint("Variable V100 does not exist!")
return -1
end if
v_wind= data->VGRD
v_wind@_fillvalue="_"
; if (.not.isfilevar(data, "lev")) then
; myPrint("Variable lev does not exist!")
; return -1
; end if
; lev_wind= data->lev
if (.not.isfilevar(data, "lat")) then
myPrint("Variable lat does not exist!")
return -1
end if
lat = data->lat
if (.not.isfilevar(data, "lon")) then
myPrint("Variable lon does not exist!")
return -1
end if
lon = data->lon
; u1=u_wind(0,:,:)
; v1=v_wind(0,:,:)
; u1@_fillvalue=9.96921e+36
; v1@_fillvalue=9.96921e+36
; setProperty(lon,lat)
; setCoordinate(u1,lon,lat) ;给数据附属性
; setCoordinate(v1,lon,lat) ;给数据附属性
; print (lon)
; exit
;***********************************读取配置文件信息******************************
;配置文件名称
;outputPath="$PRODUCTDIR"
outputPath="$WORKDIR"
wks_type = "png"
wks_type@wkWidth = 1200 ;工作台宽度
wks_type@wkHeight = 1200 ;工作台高度
vec_res = True
; 左上角坐标
vec_res@vpXF = 0.12
vec_res@vpYF = 0.9
; 调节矩形的长宽
vec_res@vpWidthF = 0.75
vec_res@vpHeightF = 0.8
vec_res@mpDataBaseVersion = "Ncarg4_1" ; choose more recent database
vec_res@mpDataSetName = "Earth..4" ; high resolution
vec_res@mpOutlineBoundarySets = "National" ; National borders
vec_res@mpNationalLineColor = "Black" ; National borders color
vec_res@mpOutlineOn = True
vec_res@gsnDraw = False
vec_res@gsnFrame = False
vec_res@gsnAddCyclic = False ; regional data
vec_res@pmTickMarkDisplayMode ="Never"
vec_res@tmXBOn = False
vec_res@tmXTOn = False
vec_res@tmYLOn = False
vec_res@tmYROn = False
vec_res@vcMinFracLengthF = 0.2
vec_res@vcWindBarbScaleFactorF = 2.5 ;将单位转换为knots
vec_res@vcWindBarbTickLengthF = 0.3
vec_res@vcWindBarbTickSpacingF = 0.2
vec_res@vcRefAnnoOn = False
vec_res@gsnRightString = " "
vec_res@gsnLeftString = " "
vec_res@txString = " "
vec_res@vcRefMagnitudeF = 2. ; make vectors larger
vec_res@vcRefLengthF = 0.02 ; ref vec length
vec_res@vcGlyphStyle = "windbarb" ; select wind barbs
vec_res@vcMinDistanceF = 0.037 ; thin out windbarbs
vec_res@vcWindBarbLineThicknessF= 2
vec_res@vcWindBarbColor ="Blue"
outputfileName="Wind_vector"
wks = gsn_open_wks(wks_type,outputPath+"/"+outputfileName)
contour=gsn_csm_vector(wks, u_wind, v_wind,vec_res)
draw(contour)
frame(wks)
; cmd="convert -transparent white "+outputPath+"/"+outputfileName+".png"+" "+outputPath+"/"+outputfileName+"_T.png"
; system(cmd)
end
|
-
画8000m数据报的错
|