2.0 : WRF netcdf / CTL - irregular grids

brian vant-hull brianvanthull at YAHOO.COM
Mon Feb 4 13:34:28 EST 2008


Patrick;
   I was hoping one of the developers would respond
saying GrADS could do irregular grids.  I've decided
it wasn't designed for this, so you could write a
function in fortran etc that regrids the data (and
grads can call user defined functions) or switch to
something like IDL.

I've taken the second option, but hope someone in the
community has a non-proprietary function that can be
adopted for GrADS.  I've written rebinning functions
that sacrifice resolution, but haven't come across
non-proprietary code that will efficiently do the
interpolation needed to keep high resolution.  Unless
this is done GrADS is not very useful for use in
satellite data or arbitrary projections.

Anyone out there have such a function written?

-Brian Vant-Hull

--- Patrick Reuter <preuter at LABRI.FR> wrote:

> Dear Jennifer,
>
> it's true that grfill shows me even better that the
> WRF grid does not
> coincide with the GraDS map - but this does
> unfortunately not solve my
> problem.
>
> I think my gridpoints in the WRF netCDF file are not
> regularly spaced :
>
>      latitude       longitude    WRF grid point
> -------------------------------------------------
>      40.87268,     -6.422363,  // (0,0)
>      40.89521,     -6.104095,  // (0,1)
>      40.91678,     -5.785553,  // (0,2)
>      40.93737,     -5.466827,  // (0,3)
>      40.95699,     -5.147858,  // (0,4)
>      40.97562,     -4.828705,  // (0,5)
> .........
>      41.1133,     -6.452942,// (1,0)
>      41.13594,    -6.133362, // (1,1)
>      41.1576,     -5.813568,// (1,2)
>      41.17828,    -5.49353,  // (1,3)
>      41.19799,    -5.173309, // (1,4)
>      41.21671,    -4.852844, // (1,5)
>
> ......
> ......
>       51.72408  10.29593;  // (45,47)
>
>
> Note that the longitude makes a large step and the
> latitude slightly
> changes also when comparing (0,0) to (0,1) (0,2)
> etc. , and
> the latitude makes a large step and the longitude
> slighlty changes
> when comparing (0,0) to (1,0) (2,0) etc.
>
> Is there a possibility to tell GraDS to use this
> spacing ? Or is there
> another way to put a correct GrADS map on my
> (pre-projected?) grid ? I
> thought PDEF would make the trick.
>
> Thanks for any help, I hope I was clear.
>
> Best regards,
>
>     Patrick
>
>
>
>
>
>
>
> Jennifer Adams <jma at COLA.IGES.ORG> a écrit :
>
> > Patrick,
> > Please see comments inline.
> >
> > On Feb 2, 2008, at 11:38 AM, Patrick Reuter wrote:
> >
> >> Hi everybody,
> >>
> >> thank you for providing GraDS 2.0, it's really
> cool to open NetCDF
> >> files directly.
> >>
> >> However, I have a problem to configure the CTL
> file correctly for
> >> the lambert projection (I think PDEF is the
> issue).
> >>
> >> Here is my CTL file :
> >>
> >> dset ^file.nc
> >> dtype netcdf
> >> undef -888
> >> TITLE WRF Output Grid: Time, bottom_top,
> south_north, west_east
> >> pdef 48 46 LCCR 46.6 1.1 24.5 23.5 46.6 46.6 1.1
> 27000 27000
> > The first two args to pdef are the size of the
> native grid (the
> > dimensions of the variable in your netcdf file).
> From the metadata
> > you showed below, it looks like these numbers
> should be 49 and 47.
> > This is likely the source of your errors.
> >> xdef 48 linear -6.422363 0.319
> >> ydef 46 linear  40.87268 0.24
> > The sizes of your XDEF and YDEF axes can be
> anything you want, since
> > these define the grid you will be interpolating to
> -- they do not
> > have to be the same size as your native grid. I
> suggest picking a lat/
> > lon increment that is close to the dx/dy of your
> native grid, and
> > then choose a starting lat and an axis dimension
> that will completely
> > cover your model domain.
> >> zdef  27 linear 1 1
> >> tdef   2000 linear 29jan2008 30mn
> >> vars 1
> >> LANDMASK=>l     0  t,y,x    landmask
> >> endvars
> >>
> >> Here is my namelist.wps to configure the area of
> interest for my
> >> WRF model :
> >>
> >> &geogrid
> >> parent_id         = 1,
> >> parent_grid_ratio = 1,
> >> i_parent_start    = 1,
> >> j_parent_start    = 1,
> >> e_we          = 49,
> >> e_sn          = 47,
> >> geog_data_res = '2m',
> >> dx = 27000,
> >> dy = 27000,
> >> map_proj =  'lambert',
> >> ref_lat   = 46.6,
> >> ref_lon   = 1.1,
> >> truelat1  = 46.6,
> >> truelat2  = 46.6,
> >> stand_lon = 1.1,
> >> geog_data_path = '/mnt/scratch/meteo/geog',
> >> /
> >> ref_x = 24.5,
> >> ref_y = 23.5,
> >>
> >> Unfortunately, the landmask from the WRF output
> does not coincide
> >> with the Grads Map - a serious problem for me,
> evidently !  Please
> >> see the image illustrating my problem (it's only
> 20KB).
> > It's much easier to see if your mask lines up with
> the coastal
> > outline if you use 'gxout grfill' instead of
> contours.
> > Jennifer
> >
> >>
> >> Could anybody tell me if I am in the wrong
> direction ?
> >>
> >> I would appreciate your help. It is so hard to
> find someone with
> >> some WRF and GrADS experience to talk to.
> >>
> >> Have a nice day !
> >>  Patrick
> >>
> >> <landmask.png>
> >
> > --
> > Jennifer M. Adams
> > IGES/COLA
> > 4041 Powder Mill Road, Suite 302
> > Calverton, MD 20705
> > jma at cola.iges.org
>


Brian Vant-Hull
917-318-4481


      ____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the gradsusr mailing list