爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7293|回复: 2

[其他] 提取的问题

[复制链接]
发表于 2020-1-12 16:14:37 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

我在进行WRF模拟,进行了四层的嵌套。当提取第四层的风速时(即wrfout_d04_2019-........),出现的如图的问题。
2020-01-08 18-44-54ÆÁÄ»½ØÍ&#1.png
密码修改失败请联系微信:mofangbao
 楼主| 发表于 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)
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-1-13 08:34:35 | 显示全部楼层
此问题已初步解决
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表