- 积分
- 4843
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-10-14
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2020-1-12 16:33:46
|
显示全部楼层
这里是我的提取风速的脚本
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/wrf/WRFUserARW.ncl"
begin
a = addfiles("wrfout_d04_2019-11-10_00:00:00.nc" ,"r")
times = wrf_user_list_times(a)
ntimes =dimsizes(times)-1
time=-1
u = wrf_user_getvar(a,"ua",time)
v = wrf_user_getvar(a,"va",time)
tc=wrf_user_getvar(a, "tc",time)
td=wrf_user_getvar(a, "td",time)
rh=wrf_user_getvar(a, "rh",time)
psfc=wrf_user_getvar(a, "PSFC",time)
p=wrf_user_getvar(a, "pressure",time)
pb=wrf_user_getvar(a, "PB",time)
height = wrf_user_getvar(a, "z",time)
ter = wrf_user_getvar(a, "ter",time)
Latitude = 45.408745
Longitude = 127.663805
hh=50
res = True
res@returnInt = True
point = wrf_user_ll_to_ij(a,Longitude,Latitude,res)
point =point -1
x = point(0)
y = point(1)
nheight = conform(height,ter,(/0,2,3/))
height = height - nheight
u_ph = wrf_user_intrp3d( u,height,"h", hh,0.,False)
v_ph = wrf_user_intrp3d( v,height,"h", hh,0.,False)
tch = wrf_user_intrp3d( tc,height,"h", hh,0.,False)
tdh = wrf_user_intrp3d( td,height,"h", hh,0.,False)
ph = wrf_user_intrp3d(p,height,"h", hh,0.,False)
pbh =wrf_user_intrp3d(pb,height,"h", hh,0.,False)
rhh=wrf_user_intrp3d(rh,height,"h", hh,0.,False)
spdh= sqrt(u_ph^2 + v_ph^2)
windspdh=spdh(:,x,y)
dirh=wind_direction(u_ph,v_ph,0)
winddirh=dirh(:,x,y)
tcc=tch(:,x,y)
tdc=tdh(:,x,y)
phc=ph(:,x,y)+pbh(:,x,y)
psfcp=psfc(:,x,y)
rhc=rhh(:,x,y)
npts=ntimes
fName = "heightdata.txt"
data = new( npts, "string")
print(" Time pressure dew point temperature Temperature Wind_dir_hm Wind_speed_hm ")
print ( times+sprintf("%12.1f",phc/100)+sprintf("%12.1f",tdc)+sprintf("%12.1f",tcc)+sprintf("%12.0f",winddirh)+sprintf("%12.1f", windspdh) )
data = times +sprintf("%12.1f",phc/100)+sprintf("%12.1f",tdc)+ sprintf("%12.1f",tcc)+sprintf("%12.0f",winddirh)+sprintf("%12.1f", windspdh)
asciiwrite (fName,data) |
|