- 积分
- 417
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-27
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大神好!
麻烦请问,用ncl处理wrfout时,如何作区域平均?下面贴上我的ncl:
;*************************************************
; WRF: color over LC map with lat/lon labels
;************************************************
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/WRF_contributed.ncl"
begin
;************************************************
; open file and read in data
;************************************************
f = addfile ("F:\wangjing2\wrf-out\wrfout_d01_2000-04-01_00_00_00_2000_09_01_tt", "r")
times = chartostring(f->Times) ; built-in function
ntim = dimsizes(times) ; # time steps
rainc = f->RAINC ; (Time, south_north, west_east)
rainnc = f->RAINNC
;************************************************
rainc = rainc > 0.0
rainnc = rainnc > 0.0
rainTot = rainc + rainnc
rainTot@description = "Precipitation"
rainTot@units = rainc@units
;************************************************
x = (rainTot(ntim-1,:,:)-rainTot(60,:,:))/92;PH ; (Time, bottom_top, south_north, west_east)
wks = gsn_open_wks("png" ,"wrfout_d01_2000-04-01_00_00_00_2000_09_01_tt-rain678") ; ps,pdf,x11,ncgm,eps
gsn_define_colormap(wks,"MPL_BrBG") ; select color map
res = True ; plot mods desired
res@gsnSpreadColors = True ; use full range of colormap
res@cnFillOn = True ; color plot desired
res@cnLinesOn = False ; turn off contour lines
res@cnLineLabelsOn = False ; turn off contour labels
res@gsnSpreadColorStart = 66
res@gsnSpreadColorEnd = 128
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF =0
res@cnMaxLevelValF = 20
res@cnLevelSpacingF = 2
res@cnLevelSelectionMode = "ExplicitLevels"
WRF_map_c(f, res, 0) ; reads info from file
res@tfDoNDCOverlay = True
if (.not.res@tfDoNDCOverlay) then
x@lat2d = f->XLAT(0,:,:) ; direct assignment
x@lon2d = f->XLONG(0,:,:)
end if
res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks
res@tiMainString = times(61)+"-"+times(ntim-1)
res@gsnLeftString = x@description
plot = gsn_csm_contour_map(wks,x(:,:),res)
;下面开始作区域平均
shAve = wgt_areaave_Wrap(x( {27:31}, {105:120}), 1.0,1.0, 1)
printVarSummary(shAve)
asciiwrite("wrfout_d01_2000-04-01_00_00_00_2000_09_01_tt_aave.txt", shAve)
end
出错在:
fatal:Dimension (1) of (x) is not named and therefore doesn't have an associated coordinate variable
怎么给x赋上wrfout的经纬度信息呢?或者还有其他的方法来做区域平均?求助!
|
|