- 积分
- 91
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-10-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"
begin
;diri = "./"
fili = "E:/hd/fnl/fnl_20200721_12_00.grib2"
setfileoption("grib2", "SingleElementDimensions", "Initial_time")
f = addfile(fili, "r")
p = f->lv_ISBL0
time = f->initial_time0_encoded
lat2d = f->lat_0
lon2d = f->lon_0
print("lat2d: min=" + min(lat2d)+" ; max="+max(lat2d))
print("lon2d: min=" + min(lon2d)+" ; max="+max(lon2d))
p = p*0.01
p@units = "hPa"
lat = (/41.65/)
lon = (/123.5/)
npts = dimsizes(lat)
skewtOpts = True
skewtOpts@DrawColAreaFill = True
dataOpts = True
dataOpts@PrintZ = True
do n=0,npts-1
nm = getind_latlon2d (lat2d, lon2d, lat(n), lon(n))
nn = nm(0,0)
mm = nm(0,1)
print("location=("+lat(n)+", "+lon(n)+") grid=("+lat2d(nn,mm)+", "+lon2d(nn,mm)+")")
tk = f->TMP_P0_L100_GLL0(0,:,nn,mm)
z = f->HGT_P0_L100_GLL0(0,:,nn,mm)
rh = f->RH_P0_L100_GLL0(0,:,nn,mm)
u = f->UGRD_P0_L100_GLL0(0,:,nn,mm)
v = f->VGRD_P0_L100_GLL0(0,:,nn,mm)
tc = tk - 273.15
tc@units= "degC"
q = mixhum_ptrh (p, tk, rh, 2)
q@units = "kg/kg"
tdc = dewtemp_trh(tk,rh) - 273.15
tdc@units = "degC"
wspd = sqrt(u^2 + v^2)
wdir = wind_direction(u,v,0)
itime = toint(time)
skewtOpts@tiMainString = "RUC:"+itime+":("+lat(n)+","+lon(n)+")"
wks = gsn_open_wks ("png", "ruc2anl_skewt_"+itime+"_"+sprinti("%0.3i", n))
skewt_bkgd = skewT_BackGround (wks, skewtOpts)
skewt_data = skewT_PlotData(wks, skewt_bkgd, p, tc, tdc, z, wspd, wdir, dataOpts)
draw (skewt_bkgd)
draw (skewt_data)
frame(wks)
end do
end
报错:fatal:Number of dimensions in parameter (0) of (getind_latlon2d) is (1), (2) dimensions were expected
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 28 in file
|
|