Re: Regridding

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 19 2013 - 11:55:45 MST

As indicated by the printVarSummary, your source grid
goes north-to-south
             N => S
    lat: [83.625415..-55.95233499999865]

The linint2 wants both source and destination grid
to be south-to-north. This is simple to do.

fili = "med_c0_kgm-2.nc"
a = addfile (fili, "r")
t=a->y
printVarSummary(t)
t = t(::-1,:) ; reverse latitudes
printVarSummary(t)

On 02/19/2013 11:05 AM, Jiang, Lifen wrote:
> 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"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> begin
> a = addfile ("med_c0_kgm-2.nc", "r")
> t=a->y
> printVarSummary(t)
> ;create a sequence for the new values of lat
> newlat=fspan(-89.50,89.50,180)
> ;create a sequence for the new values of lon
> newlon=fspan(-179.5,179.5,360)
> newlat@units = "degrees_north"
> newlon@units = "degrees_east"
> regrid=linint2(t&lon,t&lat,t,True,newlon,newlat,0)
> regrid!0 = "LAT"
> regrid!1 = "LON"
> regrid&LAT = newlat
> regrid&LON = newlon
> printVarSummary(regrid)
> system("/bin/rm -f Regrid.nc")
> fout=addfile("Regrid.nc","c")
> fout@title="Regrid_1*1"
> fout->regrid=regrid
> en

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 19 11:55:58 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 21 2013 - 11:26:43 MST