爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6293|回复: 2

NCL绘制wrfout中qcloud的垂直剖面出错

[复制链接]
发表于 2017-10-7 10:37:29 | 显示全部楼层 |阅读模式

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

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

x

出现的错误是:fatal:Dimension (Vertical) of (qcloud) does not have an associated coordinate variable

代码如下:

begin
;---Open WRF output file
  filename = "wrfout_d03_2013-07-29_09_00_00"
  a        = addfile(filename,"r")

;---Read temperature at first time step
  time=0
  qcl = wrf_user_getvar(a,"QCLOUD",time)
  z  = wrf_user_getvar(a, "height",time)        ; grid point height
  p  = wrf_user_getvar(a, "pressure",time) ; total pressure
  dimsrh = dimsizes(qcl)
  plane = (/ dimsrh(2)/2, dimsrh(1)/2 /)    ; pivot point is center of domain

; Extract data on a W-E cross section that runs through "plane"
; Interpolate to height
  qcloud = wrf_user_intrp3d(qcl,z,"v",plane,90.0,False)

  wks = gsn_open_wks("pdf","wrf_gsn")

;---Resources for filled contour plot

  res                      = True                 ; plot mods desired

  res@cnLevelSelectionMode = "ManualLevels"       ; manually select levels
  res@cnLevelSpacingF      = 5.0                  ; contour spacing
  res@cnMinLevelValF       = -50.                 ; min level
  res@cnMaxLevelValF       =  50.                 ; max level
  res@cnLineLabelsOn       = True                 ; turn on line labels
  res@cnFillOn             = True                 ; turn on color fill
  res@cnFillPalette        = "BlWhRe"             ; choose colormap
  res@lbOrientation        = "Vertical"
  res@tiMainString         = filename

;---Necessary for contours to be overlaid correctly on WRF projection
  ;res@tfDoNDCOverlay       = True
  ;res@gsnAddCyclic         = False

;---Set map resources based on projection on WRF output file
  res = wrf_map_resources(a,res)

;---Call plotting routine which draws contours over a map
  ;nl   = 5    ; bottomost level
  ;plot = gsn_csm_contour_map(wks,qcloud(nl,:,:),res)
  plot = gsn_csm_pres_hgt(wks,qcloud({29.8},:),res)
end



请问大神们错在哪里了?
密码修改失败请联系微信:mofangbao
发表于 2017-10-30 11:57:01 | 显示全部楼层
你的plot = gsn_csm_pres_hgt(wks,qcloud({29.8},:),res),其中qcloud不是应该是三维变量吗,你少了一维垂直的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-10-31 11:51:49 | 显示全部楼层
阳光不怕晒 发表于 2017-10-30 11:57
你的plot = gsn_csm_pres_hgt(wks,qcloud({29.8},:),res),其中qcloud不是应该是三维变量吗,你少了一维垂直 ...

好的!我再研究研究,谢谢回复
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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