爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5786|回复: 0

混合坐标转化气压坐标问题

[复制链接]

新浪微博达人勋

发表于 2019-5-11 11:10:29 | 显示全部楼层 |阅读模式
NCL
系统平台: virtualbox---linux -ncl
问题截图:
问题概况: 使用vinth2p从原来的混合坐标转化为气压坐标,但不知道为什创建不成功,也没有报具体错的原因,报错截图如上,数据也尝试输出,没有问题。以下是代码
;this is for temperature in hybrid coordinate to P coordinate in the atm

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"

begin

;------------------------------------------------------
; data
;------------------------------------------------------
diri="/media/D/bishe/data/"
fili="control.501_1000y_cam.h0.nc"

f1 =addfile(diri+fili,"r")

;wks = gsn_open_wks ("eps","T_pressure_layers")

st=1
ed=500
t=f1->V(st-1:ed-1,:,:,:)

hyam=f1->hyam
hybm=f1->hybm
PS =f1->PS(st-1:ed-1,:,:)

lev_p = (/4., 8., 10., 20., 30., 40.,50.,70.,85.,100.,120.,150.,200.,250. \
, 300.,350.,400.,500.,600.,700.,800.,850.,925.,970.,990.,1000. /)

lev_p!0 = "lev_p" ; variable/dim name
lev_p&lev_p = lev_p ; create coordinate variable
lev_p@long_name = "pressure" ; attach some attributes
lev_p@units = "hPa"
lev_p@positive = "down"

P0mb = 1000. ; reference pressure [mb]
intyp = 1
nlevel = dimsizes(lev_p)


tp = vinth2p(t, hyam, hybm, lev_p, PS, intyp, P0mb, 1, True )
tp@units="pa/s"
tp@long_name="vertical velocity"

printVarSummary(tp)

;----------------------------------------------------
;creat files
;----------------------------------------------------

filo="V_pressure_control:.nc"
system("/bin/rm -f "+diri+filo)
out = addfile(diri+filo,"c")
out->V_p =tp

end
求大佬解释一波
我看过提问的智慧: 看过
自己思考时长(天): 3

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

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

x
使用vinth2p从原来的混合坐标转化为气压坐标,但不知道为什创建不成功,也没有报具体错的原因,报错截图如上,数据也尝试输出,没有问题。以下是代码
;this is for temperature in hybrid coordinate to P coordinate in the atm

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"

begin

;------------------------------------------------------
; data
;------------------------------------------------------
diri="/media/D/bishe/data/"
fili="control.501_1000y_cam.h0.nc"

f1    =addfile(diri+fili,"r")

;wks   = gsn_open_wks ("eps","T_pressure_layers")

st=1
ed=500
t=f1->V(st-1:ed-1,:,:,:)

hyam=f1->hyam
hybm=f1->hybm
PS  =f1->PS(st-1:ed-1,:,:)

lev_p      = (/4., 8., 10., 20., 30., 40.,50.,70.,85.,100.,120.,150.,200.,250. \
                , 300.,350.,400.,500.,600.,700.,800.,850.,925.,970.,990.,1000. /)

  lev_p!0         = "lev_p"                  ; variable/dim name
  lev_p&lev_p     =  lev_p                   ; create coordinate variable
  lev_p@long_name = "pressure"               ; attach some attributes
  lev_p@units     = "hPa"
  lev_p@positive  = "down"

  P0mb      = 1000.                        ; reference pressure [mb]
  intyp     = 1
  nlevel    = dimsizes(lev_p)


tp   = vinth2p(t, hyam, hybm, lev_p, PS, intyp, P0mb, 1, True )
tp@units="pa/s"
tp@long_name="vertical velocity"

printVarSummary(tp)

;----------------------------------------------------
;creat files
;----------------------------------------------------

  filo="V_pressure_control:.nc"
  system("/bin/rm -f "+diri+filo)
  out = addfile(diri+filo,"c")
  out->V_p =tp

end
求大佬解释一波

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

本版积分规则

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

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

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