Dear NCL users,
I have 90 hours of wrf data and I want to convert it into number of days.
During my conversion process the following error is appeared given below:
fatal:Undefined identifier: (rainfall_tot) is undefined, can't continue
fatal:Execute: Error occurred at or near line 31 in file rain10d1.ncl
Any advice/suggestion will be appreciated
My script is attached herewith
Thanks
wei
*************************************
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/wrf/WRF_contributed.ncl"
begin
a = addfile("/wrfout.nc","r")
times = wrf_user_list_times(a) ; get times in the file
ntimes = dimsizes(times)
print(times)
xlat = a->XLAT(0,:,:)
xlon = a->XLONG(0,:,:)
dimll= dimsizes( xlat )
nlat = dimll(0)
mlon = dimll(1)
ntim = ntimes
rainfall_hour = new ( (/ntim,nlat,mlon/), "float")
do it = 0,ntimes-1
rain_con = wrf_user_getvar(a,"RAINC",-1)
rain_exp = wrf_user_getvar(a,"RAINNC",-1)
rainfall_hour = rain_con + rain_exp
end do
ntJump = 24 ; 24 'samples' per day
prcDay = rainfall_hour(::ntJump,:,:)
ntStrt = 0
ntLast = ntJump-1
do nt=0,ntim-1,ntJump
prcDay(nt/24,:,:) = dim_sum_n(rainfall_tot(ntStrt:ntLast,:,:), 0)
ntStrt = ntStrt + ntJump
ntLast = ntLast + ntJump
end do
prcDay@long_name = "Daily total precipitation"
prcDay@units = rain_con@units
copy_VarCoords(xlat,prcDay(0,:,:))
printVarSummary(prcDay)
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Dec 6 07:18:41 2010
This archive was generated by hypermail 2.1.8 : Mon Dec 06 2010 - 09:18:09 MST