Re: curvilinear regridding

From: Matthew Fearon <Matthew.Fearon_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 19 2012 - 15:42:44 MDT

Mary,

There should be lat/long arrays in MM5 netcdf file. Names are cryptic; LATITCRS and LONGICRS, Band126 and Band127, respectively. Let me know if you don't seem them.

Matt

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

> Matt,
>
> Thanks for the files. There's no lat/lon information on the MM5
> file. I do see a description of the map projection. Are the
> lat/lon values supposed to be generated from this?
> If so, it would help if you could provide some information on this.
>
> --Mary
>
> On Jun 19, 2012, at 10:26 AM, Matthew Fearon wrote:
>
> > 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
>

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

This archive was generated by hypermail 2.1.8 : Mon Jan 14 2013 - 14:31:38 MST