- 积分
- 423
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-9
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想做一个温度露点的差的剖面图,省略res,以下是代码
;********************************************
; tkd.ncl
;********************************************
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/csm/shea_util.ncl"
begin
;---Open some netCDF files.
diri = "/home/tl/grib2/" ; input directory
fils = systemfunc ("ls " + diri + "*.grib2" ) ; file paths
f = addfiles (fils, "r")
ListSetType (f, "join") ; join
; print(f)
;---Read variables off the file and do some conversions.
tk = f[:]->TMP_P0_L100_GLL0 (1,0:20,:,100) ;各层温度(提取其中21层与相对湿度层数相匹配)
rh = f[:]->RH_P0_L100_GLL0 (1,:,:,100) ;各层相对湿度
td = dewtemp_trh (tk,rh) ;计算露点温度
tkd = tk-td - 273.15 ;温度路点差
printVarSummary(tkd)
wks = gsn_open_wks ("ps", "tkd" )
plot = gsn_csm_pres_hgt(wks,tkd,False )
end
报错信息如下:
Variable: tkd
Type: float
Total Size: 15204 bytes
3801 values
Number of Dimensions: 2
Dimensions and sizes: [21] x [181]
Coordinates:
Number Of Attributes: 1
_FillValue : 1e+20
(0) gsn_csm_pres_hgt: Fatal: The first dimension of the input data must
(0) have a coordinate variable called 'lev.'
(0) Cannot create plot.
fatal:Illegal right-hand side type for assignment
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 32 in file td.
找了很久不知道是哪里出错了,可否有同学帮忙解答,非常感谢了
|
|