- 积分
- 2
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-4-13
- 最后登录
- 1970-1-1

|
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
求大佬解释一波
|
|