- 积分
- 3548
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-10-16
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想画变量的廓线的日变化图,从wrfout文件里提取的变量是30层eta分层,然后自己做出相对高度z1替换eta,最后得到的图纵坐标间隔不合理,0—100m和其他百米的间隔都不一样长,是哪里的问题呢?求助各位大大,非常感谢~; ***********************************************
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/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;************************************************
begin
f1 = addfile ("~/wrfout_d03_2017-01-21_00:00:00.nc","r")
a11 = f1->EXCH_H(:,:,:,:)
a12 = dim_avg(a11)
a13=dim_avg(a12)
m1= new((/24,30,2/),"float")
t = ispan(0,23,1)
do i= 0,29
m1(:,i,0)=a13(16:39,i)
m1(:,i,1)=a13(40:63,i)
end do
n1 = dim_avg(m1)
g1 = f1->HGT(1,:,:)
h1=dim_avg(g1)
ter1=dim_avg(h1)
i1=wrf_user_getvar(f1,"z",0)
i1=i1-ter1
j1=dim_avg(i1)
k1=dim_avg(j1)
z1= new((30),"float")
z1(0)=0
z1(1:29)=k1(0:28)
n1!0 = "Time"
copy_VarAtts(a11,n1)
copy_VarCoords_2(a11,n1)
n1&bottom_top_stag = z1
n1&Time = t
wks = gsn_open_wks("png","contour_exch_01") ; send graphics to PNG file
res1 = True
res1@cnFillOn = True ; turn on color
res1@cnFillPalette = "amwg256"
res1@cnLineLabelsOn = False ; no contour line labels
res1@cnInfoLabelOn = False ; no info label
res1@cnLinesOn = False ; turn off contour lines
res1@vpWidthF = 0.8 ; change the aspect ratio
res1@vpHeightF = 0.6
res1@vpXF = .15 ; location of where plot starts
res1@vpYF = .9
res1@tmXBLabelFontHeightF = 0.025 ; label font height
res1@tmYLLabelFontHeightF = 0.025
res1@tmYLOn = True
res1@tmYLLabelsOn = True
; res1@trYMaxF = 1000.
res1@tmYLMode = "Manual"
res1@tmYLTickStartF = 0.
res1@tmYLTickEndF = 800.
res1@tmYLTickSpacingF = 100.
plot = gsn_csm_contour(wks,n1(bottom_top_stag|:15,Time|:),res1) ; contour the variable
end
n1和z1的属性见下:
Variable: n1
Type: float
Total Size: 2880 bytes
720 values
Number of Dimensions: 2
Dimensions and sizes: [Time | 24] x [bottom_top_stag | 30]
Coordinates:
Time: [0..23]
bottom_top_stag: [ 0..17578.91]
Number Of Attributes: 7
coordinates : XLONG XLAT
stagger : Z
units : -
description : SCALAR EXCHANGE COEFFICIENTS
MemoryOrder : XYZ
FieldType : 104
_FillValue : 9.96921e+36
Variable: z1
Type: float
Total Size: 120 bytes
30 values
Number of Dimensions: 1
Dimensions and sizes: [30]
Coordinates:
Number Of Attributes: 1
_FillValue : 9.96921e+36
(0) 0
(1) 10.13144
(2) 27.2005
(3) 45.9689
(4) 66.02456
(5) 92.78149
(6) 140.1814
(7) 191.6025
(8) 233.8749
(9) 307.2459
(10) 407.6262
(11) 481.8983
(12) 557.0893
(13) 644.8188
(14) 725.309
(15) 802.3631
(16) 884.1748
(17) 1232.071
(18) 1863.503
(19) 2539.979
(20) 3267.459
(21) 4053.219
(22) 4911.677
(23) 5863.649
(24) 6943.682
(25) 8213.806
(26) 9759.84
(27) 11791.46
(28) 14866.54
(29) 17578.91
|
-
exch
|