- 积分
- 32
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用gsn_csm_pres_hgt函数,结果出错,求大神帮帮忙
(0) gsn_csm_pres_hgt: Fatal: The first dimension of the input data must
(0) have a coordinate variable called 'lev.'
(0) Cannot create plot.
fatal:Illegal right-hand side type for assignment
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 12473 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
ncl脚本如下:
- ;================================================;
- ; gsn_contour_2.ncl
- ;================================================;
- ; Concepts illustrated:
- ; - Drawing a basic contour plot using gsn_contour
- ; - Spanning the full color map for contour fill
- ; - Turning on color fill for a contour plot
- ; - Turning off contour line labels
- ; - Turning off the contour informational label
- ; - Changing the size/shape of a contour plot using viewport resources
- ; - Increasing the size of tickmark labels
- ;
- ;================================================;
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
- ; ================================================;
- begin
- ;=================================================;
- ; open file and read in data
- ;=================================================;
- cfilename="wrfout_ncl.cfg"
- cfils =asciiread(cfilename,-1,"string")
- files = systemfunc("ls "+cfils(0)+":00:00") + ".nc"
- f = addfiles(files,"r")
- nfil=dimsizes(files)
- times = wrf_user_list_times(f)
- U10=f[:]->U10(:,:,:)
- V10=f[:]->V10(:,:,:)
- U=wrf_user_getvar(f,"ua",-1)
- V=wrf_user_getvar(f,"va",-1)
- W=wrf_user_getvar(f,"wa",-1)
- Tc=wrf_user_getvar(f,"tc",-1)
- nxy=dimsizes(U)
- nt=nxy(0)
- nz=nxy(1)
- ny=nxy(2)
- nx=nxy(3)
- pa=wrf_user_getvar(f,"pressure",-1) ;full mode pressure(hpa)
-
- pressure_levels=(/1000.,900.,850.,750.,700.,600.,500.,300.,200./)
- nleves=dimsizes(pressure_levels)
-
- VV=new((/nt,nleves,ny,nx/),float)
- UU=new((/nt,nleves,ny,nx/),float)
- WW=new((/nt,nleves,ny,nx/),float)
- TTc=new((/nt,nleves,ny,nx/),float)
-
-
- VV=wrf_user_intrp3d(V,pa,"h",pressure_levels,0.0,False)
- UU=wrf_user_intrp3d(U,pa,"h",pressure_levels,0.0,False)
- WW=wrf_user_intrp3d(W,pa,"h",pressure_levels,0.0,False)
- TTc=wrf_user_intrp3d(Tc,pa,"h",pressure_levels,0.0,False)
- wAve=avg(WW(0,:,:,10))
- uAve=avg(UU(0,:,:,10))
- scale=fabs(uAve/wAve)
- wscale=WW*scale
- copy_VarCoords(WW,wscale)
- ;=================================================;
- ; PLOT 2
- ;=================================================;
-
-
-
- res = True
- ;---This resource not needed in V6.1.0
- res@gsnSpreadColors = True ; use full colormap
- res@vcRefAnnoOn = True ; turns off the ref vector
- res@vcRefMagnitudeF = 5.0 ; add a reference vector
- res@vcRefLengthF = 0.045 ; what the ref length is
- res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
-
- do ifle=0,0
- wks = gsn_open_wks("png",cfils(1)+"/gsi_UW_"+times(ifle))
- gsn_define_colormap(wks,"gui_default")
-
-
- plot=gsn_csm_pres_hgt_vector(wks,TTc(ifle,:,:,10),UU(ifle,:,:,10),wscale(0,:,:,10),res)
- end do
-
-
- end
复制代码
|
|