# regridding TRMM data to 0.5 degree grid

From: Erik Noble <nobleeu_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 17 2011 - 16:46:23 MST

Hi. This is a follow-on to the question posed by B N here
http://www.ncl.ucar.edu/Support/talk_archives/2009/1554.html

If TRMM data is already on a grid 0.25 by 0.25 grid, where its
coordinate variables are
( from example 7 at http://www.ncl.ucar.edu/Applications/HiResPrc.shtml)

nlat = 400
mlon = 1440
lat = ispan(0,nlat-1,1)*0.25 - 49.875
lon = ispan(0,mlon-1,1)*0.25 - 179.875

lat@long_name = "latitude"
lat@units = "degrees_north"
lat!0 = "lat"
lat&lat = lat

lon@long_name = "longitude"
lon@units = "degrees_east"
lon!0 = "lon"
lon&lon = lon

which method ( A or B ) below would be better for re-gridding
specifically the TRMM data to 0.5 by 0.5?
Both?
Sincerely,
Erik

A)
;****************
; Regrid to 0.50 degree
;****************
nlat = 200
mlon = 720

latGRID = ispan(0,nlat-1,1)*0.50 - 49.875
latGRID!0 = "lat"
latGRID@units = "degrees_north"
latGRID&lat = latGRID
NLAT = dimsizes(latGRID)

lonGRID = ispan(0,mlon-1,1)*0.50 - 179.875
lonGRID!0 = "lon"
lonGRID@units = "degrees_east"
lonGRID&lon = lonGRID
MLON = dimsizes(lonGRID)

var = rain
; var = lonFlip(var)
lat = var(0,:,0)
opt = True
var_o = area_hi2lores_Wrap (var&lon,var&lat, var , True, 1, lonGRID,
latGRID, False)

or B)

;****************
; Regrid to 0.50 degree
;****************
nlat = 233
mlon = 720
dlon = 0.5

latGRID = fspan(-58,58,nlat)
latGRID!0 = "lat"
latGRID@units = "degrees_north"
latGRID&lat = latGRID
NLAT = dimsizes(latGRID)

lonGRID = fspan(0,mlon-1,dlon)*dlon, mlon)
lonGRID!0 = "lon"
lonGRID@units = "degrees_east"
lonGRID&lon = lonGRID
MLON = dimsizes(lonGRID)

var = rain
; var = lonFlip(var)