爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5612|回复: 0

水汽通量散度时间高度剖面图求助

[复制链接]
发表于 2022-10-16 17:39:03 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

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


密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表