- 积分
- 3
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2021-5-31
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想将wrfout插值到500hpa,看其流场图,代码如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
dir="./"
filename="wrfout_d01_2022-08-12_18_00_00"
a = addfile(dir+filename,"r")
wks = gsn_open_wks("pdf","500hpa")
gsn_define_colormap(wks,"gui_default")
; Set some Basic Plot options
res = True
res@MainTitle = "WRF-500hpa"
pltres = True
mpres = True
mpres = True
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpUSStateLineThicknessF = 1
mpres@mpDataBaseVersion="MediumRes"
mpres@mpDataSetName="Earth..4"
mpres@mpOutlineSpecifiers = (/"China:states","India","Nepal","Bhutan","Bangladesh","Myanmar", \
"Thailand","Cambodia","Vietnam","Taiwan"/)
; What times and how many time steps are in the data set?
times = wrf_user_list_times(a) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
do it = 0,ntimes-1 ; TIME LOOP
print("Working on time: " + times(it) )
res@TimeLabel = times(it) ; Set Valid time to use on plots
;hgt
ph = wrf_user_getvar(a,"PH",it) ; perturbation geopotential
phb = wrf_user_getvar(a,"PHB",it) ; BASE STATE geopotential
ph = (ph + phb)/9.8
;pressure
p = wrf_user_getvar(a,"P",it) ; perturbation pressure
pb = wrf_user_getvar(a,"PB",it) ; BASE STATE PRESSURE
p = p + pb
ht_500 = wrf_user_intrp3d(ph,p,"v",500,0,False)
ph@description = "hgt_500(bottom_top_stag)"
ph@units = "m"
; hgt
opts = res
opts@cnLineColor = "Green"
contour = wrf_contour(a,wks,ht_500(:,:),opts)
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
delete(opts)
end do
end
报错如下:
Variable: times
Type: string
Total Size: 24 bytes
3 values
Number of Dimensions: 1
Dimensions and sizes: [3]
Coordinates:
Number Of Attributes: 2
description : times in file
_FillValue : missing
(0) 2022-08-12_18:00:00
(1) 2022-08-12_21:00:00
(2) 2022-08-13_00:00:00
(0) Working on time: 2022-08-12_18:00:00
fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading z_in
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 344 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 44 in file hgt_500.ncl
作为一个NCL小白,,,,我555555555
谢谢大佬QAQ
|
|