- 积分
- 1831
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-6
- 最后登录
- 1970-1-1
|
GrADS
系统平台: |
linux |
问题截图: |
- |
问题概况: |
俩个数组dv2,vr2,将这俩数组相除svbit=dv2/vr2。我想将dv2,vr2同时小于0的情况舍去,利用where函数将满足情况下的svbit设为缺省(将值设的很大,在输出时不予显示)。但是运行后ncl给予警告。warning:ContourPlotInitialize: scalar field is constant; no contour lines will appear; use cnConstFEnableFill to enable fill |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
2 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
下面是我的脚本:请大家帮我看看,谢谢!
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/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
begin
in = addfile("/home/zssapr/WRF3.5.1/20110710/WRFV3/test/em_real/wrfout_d02_2011-07-05_00:00:00","r")
FNM =in->FNM
U =in->U
ua = wrf_user_unstagger(U,U@stagger)
V = in->V
va = wrf_user_unstagger(V,V@stagger)
lat = in->XLAT(0,:,0)
lon = in->XLONG(0,0,:)
scale=1.e05
dv = new ( dimsizes(ua), typeof(ua), ua@_FillValue )
dv@long_name = "divengence"
dv@units = "scaled"
dv = uv2dv_cfd (ua,va,lat,lon, 2)
ud = new ( dimsizes(ua), typeof(ua), ua@_FillValue )
vd = new ( dimsizes(va), typeof(va), va@_FillValue )
copy_VarCoords(ua, ud )
copy_VarCoords(ua, vd )
dv2uvg(dv,ud,vd) ; div ==> divergent wind components
ud@long_name = "Zonal Divergent Wind"
ud@units = ua@units
vd@long_name = "Meridional Divergent Wind"
vd@units = va@units
dv2 = uv2dv_cfd (ud,vd,lat,lon, 2)
vr = new ( dimsizes(ua), typeof(ua), ua@_FillValue )
vr@long_name = "vorticity"
vr@units = "scaled"
vr = uv2vr_cfd (ua,va,lat,lon, 2) * scale
uort = new ( dimsizes(ua), typeof(ua), ua@_FillValue )
vort = new ( dimsizes(va), typeof(va), va@_FillValue )
copy_VarCoords(ua, uort )
copy_VarCoords(ua, vort )
vr2uvg(vr,uort,vort) ; div ==> rotational wind components
uort@long_name = "Zonal Divergent Wind"
uort@units = ua@units
vort@long_name = "Meridional Divergent Wind"
vort@units = va@units
vr2 = uv2vr_cfd (uort,vort,lat,lon, 2)
svbit = new ( dimsizes(ua), typeof(ua), ua@_FillValue )
svbit =where(vr2.le.0.and.dv2.le.0,9.e99,dv2/vr2)
printVarSummary(svbit)
copy_VarCoords(ua, svbit)
;copy_VarCoords(ua, vr)
;Svbit = dim_avg_n_Wrap(svbit(:, :, 18 :36 , 18 :45 ), (/2, 3/))
;log_Svbit=new ( dimsizes(Svbit), typeof(Svbit) )
;copy_VarCoords(Svbit,log_Svbit)
;log_Svbit =log10( abs(Svbit))
wks = gsn_open_wks("ps","svbit_udvr")
gsn_define_colormap(wks,"BlueWhiteOrangeRed")
res = True
res@cnFillOn = False
res@cnLinesOn = True
res@vpWidthF = 0.5 ; change aspect ratio of plot
res@vpHeightF = 0.3
res@cnSmoothingOn = True
res@cnConstFEnableFil =True
res@cnLevelSelectionMode ="ExplicitLevels"
res@cnLevels =(/-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8/)
plot = gsn_csm_contour(wks,Svbit(bottom_top|0:20,Time|:),res)
end
|
|