- 积分
- 643
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-7-5
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-8-12 15:49:52
|
显示全部楼层
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/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
f = addfile("./WRFV3/test/em_quarter_ss/wrfout_d01_0001-01-01_00:00:00.nc","r")
w = wrf_user_getvar(f,"QCLOUD",-1)
xlat = wrf_user_getvar(f,"XLAT",-1)
xlong = wrf_user_getvar(f,"XLONG",-1)
lev = wrf_user_getvar(f,"pressure",-1)
ntimes = dimsizes(w(:,0,0,0))
wbt = dimsizes(w(0,:,0,0))
wsn = dimsizes(w(0,0,:,0))
wwe = dimsizes(w(0,0,0,:))
out = new((/wbt,ntimes,wsn,wwe/),"float",0)
do it = 0,ntimes-1
do bt = 0,wbt-1
chu = w(it,bt,0,0)
yy = 0
xx = 0
do sn = 0,wsn-1
do we = 0,wwe-1
if(w(it,bt,sn,we).gt.chu) then
chu=w(it,bt,sn,we)
yy = sn
xx = we
end if
end do
end do
out(it,bt,0,0)= w(it,bt,yy,xx)
print(it)
end do
end do
out!0="lev"
out&lev=lev
slice =out(lev|:,Time|:,south_north|0,west_east|0)
;================================================
; plot
;================================================
wks = gsn_open_wks ("pdf", "h_time") ; open ps file
gsn_define_colormap(wks,"BlWhRe") ; choose colormap
res = True ; plot mods desired res@cnFillOn = True ; turn on color
res@cnLinesOn = False ; no contour lines
;---This resource not needed in V6.1.0
res@gsnSpreadColors = True ; use full range of colors
;---This resource defaults to True in NCL V6.1.0
res@lbLabelAutoStride = True ; optimal labels
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = .001 ; set min contour level
res@cnMaxLevelValF = .01 ; set max contour level
res@cnLevelSpacingF = 0.0001 ; set contour spacing
plot = gsn_csm_pres_hgt (wks,slice,res)
end
这个是我的脚本,还是提示fatal:Subscript out of range, error in subscript #0
fatal:Execute: Error occurred at or near line 35 in file test.ncl
|
|