Re: curvilinear regridding

From: Matthew Fearon <Matthew.Fearon_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 19 2012 - 10:26:08 MDT

Hi Mary,

Thank you. This is exactly what I need. I placed 2 netcdf files on an anonymous ftp

1. raw wrf file: wrfout_d03_2012-04-22_23:00:00.nc
2. processed mm5 file: 2010-04-30-12.nc

ftp://pubfiles.dri.edu/pub/mfearon/

Spatially, file 2 is a sub-domain of file 1. My plan is to align corresponding variables from file 1 to those in file 2. Please let me know if you have any questions about the files as you have time to work with them. Thank you again for your assistance.

Matt

----- Original Message -----
From: Mary Haley <haley@ucar.edu>
Date: Tuesday, June 19, 2012 8:02 am
Subject: Re: [ncl-talk] curvilinear regridding
To: Matthew Fearon <Matthew.Fearon@dri.edu>
Cc: ncl-talk@ucar.edu

> Hi Matt,

> In Version 6.1.0-beta of NCL, we have some new ESMF regridding routines that allow you to go from rectilinear, curvilinear, or unstructured grids, to any one of these three grids.> You should be able to use this software to go from a curvilinear grid to a curvilinear grid.>
> Here's a code snippet of what the regridding might look like. I'm assuming that the file that contains the "source" WRF grid is called "wrf_output.nc", and that the curvilinear lat/lon grid on the file is called "XLAT" and "XLONG". I'm also assuming XLAT and XLONG are 3D, so I'm just grabbing the first time step of both.>
> Finally, I'm assuming that the "destination" MM5 grid is on a file called "mm5_grid.nc" and that the curvilinear lat/lon variables are simply called "lat" and "lon":>
> ;---Read the source and destination lat/lon grids                                             
>     srcFileName = "wrf_output.nc"
>     dstFileName = "mm5_grid.nc"
>
>     sfile       = addfile(srcFileName,"r")
>     dfile       = addfile(dstFileName,"r")
>
>     src_lat     = sfile->XLAT(0,:,:)
>     src_lon     = sfile->XLON(0,:,:)
>     dst_lat     = dfile->lat
>     dst_lon   =   dfile->lon
>
> ;---Read the data you want to regrid
>     x = sfile->x
>
> ;---Options for regridding
>     Opt                 = True
>
> ;---source grid information
>     Opt@SrcRegional     = True
>     Opt@SrcGridLat      = src_lat
>     Opt@SrcGridLon      = src_lon
>
> ;---destination grid information
>     Opt@DstRegional     = True
>     Opt@DstGridLat      = dst_lat
>     Opt@DstGridLon      = dst_lon
> ;
> ; If you run the script multiple times, then the three
> ; NetCDF files that get written (source description
> ; file, destination description file, and weights file) 
> ; will be overwritten without any prompting.
> ;
>     Opt@ForceOverwrite  = True
>
>     Opt@CopyVarCoords   = True   ; Whether to copy coordinate information 
>                                  ; to regridded variable
>
>     Opt@InterpMethod = "bilinear"            ; (default) "patch" or "conserve"
>
>     xregrid = ESMF_regrid(x,Opt)     ; Regrid "x" to new grid
>
>
> If you are able to provide me with a sample of both grids, I would be happy to add an example to our ESMF regridding page:>
> http://www.ncl.ucar.edu/Applications/ESMF.shtml>
> Cheers,>
> --Mary>
> On Jun 19, 2012, at 8:44 AM, Matthew Fearon wrote:> > Dear NCL users:
>
> I'm working with both older MM5 output and more recent WRF for an overlapping spatial domain. I would like to aggregate / regrid WRF output to the MM5 grid, 2km to 4km, respectively. Is there a pre-written tool in NCL to do this? I see there's options for going from curvilinear to rectilinear and vice versa, but not curvilinear to curvilinear?
>
> Suggestions would be very helpful, thanks,
> Matt
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 19 10:26:17 2012

This archive was generated by hypermail 2.1.8 : Mon Jun 25 2012 - 09:57:23 MDT