- 积分
- 128
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-9-9
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-4-18 11:48:41
|
显示全部楼层
太感谢你提供的线索了。已经完美解决~~~~
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
a = addfile("/home/yjane/A/DATA/0814/wrfout_d01_2008-09-19_00:00:00.nc","r")
type = "pdf"
wks = gsn_open_wks(type,"A")
FirstTime = True
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,2 ; TIME LOOP
print("Working on time: " + times(it) )
u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical coordinate
z = wrf_user_getvar(a, "z",it) ; grid point height
ip_lats = 19.3
ip_lons = 122.1
loc = wrf_user_ll_to_ij(a, ip_lons, ip_lats, True)
locX = loc(0)
locY = loc(1)
zz = z(0:28,locY,locX)
uu = u(0:28,locY,locX)
vv = v(0:28,locY,locX)
ww = sqrt(uu*uu+vv*vv)
npts = 28
i = ispan(0,npts,1)
x = zz
y = ww
write_table("111.txt","w",[/i,x,y/],"%4.0i,%8.3f,%8.3f")
; plot = gsn_csm_xy(wks,ww,zz,True)
end do
end
输出:
, 30.193, 13.561
1, 103.739, 14.585
2, 203.880, 14.894
3, 331.255, 15.102
4, 491.163, 16.094
5, 694.136, 17.696
6, 942.770, 17.549
7,1310.133, 16.321
8,1785.575, 14.777
9,2283.600, 13.944
10,2806.787, 13.409
11,3574.205, 13.449
12,4571.870, 14.131
13,5569.703, 14.704
14,6570.219, 13.124
15,7573.914, 10.766
16,8579.515, 9.296
17,9585.817, 8.509
18,10592.381, 6.163
19,11598.784, 5.391
20,12603.500, 3.666
21,13605.701, 10.197
22,14589.490, 14.069
23,15540.371, 13.134
24,16465.520, 12.077
25,17382.625, 12.120
26,18310.816, 9.919
27,19256.744, 8.609
28,20220.537, 8.622
eta分层为28层,共28行,第二列是高度,第三列是速度。 |
|