Re: Convert from Mercator to regular Lat/Lon grids

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 28 May 2007 17:17:00 -0600 (MDT)

A correction ...

On Mon, 28 May 2007, Dennis Shea wrote:

> > I want to convert the WRF output files (on native Mercator
> > projection) to Lat/Lon projection and then write the converted data to a
> > separate netcdf file. Thus i will be having two files i.e 1) original WRF
> > output file on Mercator projection 2) converted netcdf file on Lat/Lon
> > projection.
> ------------------------------
>
> I think this might be a better question for wrfhelp_at_ucar.edu
> Perhaps, they have software to do this.
>
> ---
> You provide no details.
>
> It seems to me you are asking how you can intterpolate from one grid
> with two dimensional latitude/longitude coordinates to another grid
> with two dimensional latitude/longitude coordinates.
>
> ---
>
> I assume that the latitude/longitude arrays for the mercator
> are two-dimensional. Also, I assume these arrays have a time dimension.
> The following assumes that the lat/lon arrays do not change with time.
>
> See:
> http://www.ncl.ucar.edu/Document/Functions/Built-in/rgrid2rcm.shtml
     http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml
>
>
> ---
> ; ***UNTESTED***
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> f = addfile ("...", "r") ; Mercator
> latm = f->XLAT(0,:,:) ; [*][*]
> lonm = f->XLONG(0,:,:)
> xm = f->X
>
> g = addfile ("...", "r") ; Lambert Conformal
> latlc = g->XLAT(0,:,:) ; [*][*]
> lonlc = g->XLONG(0,:,:)
>
> if (niceLatLon2D(latm,lonm)) then

         xlc = rgrid2rcm (latm(:,0), lonm(0,:), xm, latlc, lonlc, 0) ; faster

> else
> xlc = rcm2points (latm, lonm, xm, ndtooned(latlc), ndtooned(lonlc), 0) ; slow
> end if
> latlc_at_units = "degrees_north"
> lonlc_at_units = "degrees_east"
     latlc!0 = "south_north"
     latlc!1 = "west_east"
     lonlc!0 = "south_north"
     lonlc!1 = "west_east"
     
     printVarSummary(latlc)
     printVarSummary(lonlc)
     
>
> ---
> Good luck
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 28 2007 - 17:17:00 MDT

This archive was generated by hypermail 2.2.0 : Tue May 29 2007 - 07:20:15 MDT