[Thread Prev][Thread Next][Index]

SUMMARY: Using Ferret with a icosahedral grid.




Dear Ferret users,

This summary relates to a message I sent before Xmas. The essence of the
problem was that I have a model which uses an icosahedral-hexagonal grid
which is irregular in both latitude and longitude. This presented
difficulties in getting Ferret to plot the data since variables were not
indexed by latitude and longitude but indirectly via cell number.

Thanks to both Steve Hankin and Jörg Kaduk for very prompt responses.

A quick fix would be to use the 'objective' function which assumes the data
is randomly spaced and regrids it. The side effect of this is that (for my
grid) it tends to leave gaps in the polar regions and generates another
file.

With this type of grid the interpolation to a regular grid involves 3
nearest neighbours (not 4) as the grid is based on triangles. The best
solution therefore is to use Ferret's External Function interface to
develop a customised interpolation command to put the data to a regular
grid. Another advantage is that this doesn't create another dataset unless
I decide to save it.

I'll probably get shot down in flames for mentioning this but I also took a
look at GrADS which has a similar problem with this grid. They also have an
external function interface but communication with GrADS is done via
external temporary files whereas in Ferret external functions are loaded as
shared objects and transfer of arguments to the functions is done via
memory: this seems to me to be a more efficient approach.

Thanks are due to the Ferret team for providing the software and excellent
support.

     Glenn Carver

Original message follows -----------

I want to use Ferret to visualise results from a stratospheric model. The
complication is that this model uses a hexagonal-icosahedral grid which is
not regular in latitude and longitude. The output goes to a netCDF file
which Ferret reads fine.

The difficulty is that the model nodes are numbered according to the grid
square number (or 'face' number) and we use a lookup array for the latitude
and longitude position e.g.
  TEMP(iface,ilevel,itime) would have a lat./long. coordinate of
LAT(iface), LONG(iface) and this is how the data is stored in the netCDF
file. LAT and LONG are invariant coordinate variables in the netCDF file.
Worst still the coordinates are not stored in the order you might naturally
expect for graphics. That is, we don't start from 90N,0E moving east and
south through the grid. For computational reasons the coords are ordered
such as you cannot rely on consecutive nodes being adjacent as ordered in
the variable arrays.

So Ferret doesn't see the variables on a lat-long grid but an abstract one.
At the moment, I can't quite see how to use Ferret to produce lat-long
plots of the main model variables.  My first thought was to regrid the data
but Ferret only appears to allow regridding of variables when the same no.
of axes are involved; unlike my case where I want to go from the single
axes (iFACE) to two axes (lat/long).

An obvious option would be to interpolate the data in the model before
writing to netCDF. However, as these files are the main model output, we'd
prefer not to do this.

Any suggestions on how to proceed would be very welcome.

    Glenn


-----------------------------------------------------------------------
Dr. Glenn Carver, Senior Research Associate    Phone: +44 (1223) 336524
Centre for Atmospheric Science,                Fax:   +44 (1223) 336473
Cambridge University, Chemistry Dept.,    Glenn.Carver@atm.ch.cam.ac.uk
Lensfield Road, Cambridge, CB2 1EW, UK    www.atm.ch.cam.ac.uk/~glenn/

         "Genius is one percent inspiration and ninety nine
          percent perspiration"   Thomas Edison.
_______________________________________________________________________




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement