Re: Convert from Mercator to regular Lat/Lon grids

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

> 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
---
; ***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 (lat2d(:,0), lon2d(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"
---
Good luck
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 28 2007 - 17:00:53 MDT

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