Hi. May I have some help?
I am using the following script to regrid a modeled rainfall data on a
55km grid to a 1/2-degree grid. The data is not cyclical and is on a
small domain. Even thought the data is regional, I want to put it on a
1/2-degree grid, so I tried putting in on a global grid.
When I read-in the data and examine the minimum and maximum values, I
see that I have successfully read in the file and the variable. But
when I check the mins and maxs after regridding with area_hi2lores, I
get "zeros."
Is this expected?
How can I get the result that I want?
Sincerely,
Erik
Code:
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"
;*************** User Input **************************************
diri ="./"
fili = "wrfout_*_precip.nc"
diro = "./"
all_files = systemfunc ("ls "+fili)
numFILES = dimsizes(all_files)
;*************** DO LOOP TO READ and REGRID FILES ****************
do it = 0,numFILES-1
print("File = "+all_files(it))
a = addfile (all_files(it),"r")
rain = a->rain
printVarSummary(rain)
printMinMax(rain,True)
;****************
; Regrid to 0.5 degree
;****************
nlat = 360
mlon = 720
latGRID = fspan(-90,90, nlat)
latGRID!0 = "lat"
latGRID@units = "degrees_north"
latGRID&lat = latGRID
lonGRID = fspan(-180,180, mlon)
lonGRID!0 = "lon"
lonGRID@units = "degrees_east"
lonGRID&lon = lonGRID
var = rain
var_o = area_hi2lores_Wrap (var&lon,var&lat, var , False, 1,
lonGRID, latGRID, False)
printVarSummary(var_o)
printMinMax(var_o,True)
;****************
; Output to Netcdf
;****************
NCFILE1 = all_files(it)
NCFILE = "Regrid_0.5_"+NCFILE1
system("/bin/rm -f "+diro+NCFILE)
ncdf = addfile(diro+NCFILE ,"c")
filedimdef(ncdf,"Time",-1,True)
ncdf->prate=var_o
delete(ncdf)
delete(NCFILE)
end do
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 18 15:43:00 2011
This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:15 MST