question related to area_hi2lores

From: Erik Noble <nobleeu_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 18 2011 - 15:42:53 MST

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?



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_*"
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
  ; 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)

  ; Output to Netcdf
  NCFILE1 = all_files(it)
  NCFILE = "Regrid_0.5_"+NCFILE1
  system("/bin/rm -f "+diro+NCFILE)
  ncdf = addfile(diro+NCFILE ,"c")
end do
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
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