- 积分
- 73
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-11-6
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大佬好,刚接触NCL小白画图时遇到:
warning:ContourPlotInitialize: scalar field is constant; no contour lines will appear; use cnConstFEnableFill to enable fill
不知道到底是公式问题还是数据还是时间的问题,望各位大神多多指教。
代码如下:
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/cnmap/cnmap.ncl"
begin
f=addfile("2009-dier.nc","r")
u1 = short2flt(f->u)
v1 = short2flt(f->v)
t = short2flt(f->t(0:2,{100:1000},{30.94},{105.33}))
u = short2flt(f->u(0:2,{100:1000},{30.94},{105.33}))
v = short2flt(f->v(0:2,{100:1000},{30.94},{105.33}))
; rhum= short2flt(f->r({0:2},{10:1000},{30.94},{105.33}))
q = short2flt(f->q(0:2,{100:1000},{30.94},{105.33}))
sqtlu=q*u/9.8
sqtlv=q*v/9.8
;vapord=uv2dv_cfd(q*u/9.8)*1000000000
copy_VarCoords(u, sqtlu)
copy_VarCoords(v, sqtlv)
;printVarSummary(v1)
vapord= uv2dv_cfd(sqtlu,sqtlv,sqtlu&time,sqtlv&level,3)*1000
;print(vapord)
level = f->level
lev = t&level
day = ispan(0,2,1)
R = transpose(vapord)
R!0 = "level"
R&level = level({100:1000})
R!1 = "day"
R&day = day
wks = gsn_open_wks("png","a")
gsn_define_colormap( wks ,"BlWhRe")
res = True
res@tiMainString = " before"
res@gsnMaximize = False
res@gsnDraw = False
res@gsnFrame = False
res@cnConstFEnableFill = True
res1 = res
res@cnInfoLabelOn = False
res@gsnLeftString = ""
res@gsnRightString ="1 g/(s*hPa*cm^2)"
res@cnFillOn = True
res@cnLinesOn = True
res@cnLineLabelsOn = True
res@cnLineColor = "blue"
res@cnFillPalette = "BlRe"
;res@cnLevelSelectionMode = "ManualLevels"
;res@cnMinLevelValF = -2.5 ; set min contour level
;res@cnMaxLevelValF= 3. ; set max contour level
res@gsnSpreadColors = True
res@lbLabelAutoStride = True
;res@lbBoxEndCapStyle = "TriangleBothEnds"
res@cnFillDrawOrder = "PreDraw"
res@cnLevelSpacingF= 0.5
plot = gsn_csm_pres_hgt(wks, R,res )
draw(plot)
frame(wks)
end
|
|