Re: Rotating a lat/lon grib (with u/v wind)

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue, 26 Aug 2008 14:02:57 -0600

Hi Bengt,

It sounds like the original file you are reading is a GRIB file. If
so, then data that is on a rotated lat/lon grid will have
an associated rotation variable that is dynamically generated when
the file is opened. The exact spelling of the
variable name varies depending on how the grid is defined in the
GRIB file and whether the file is GRIB 1 or GRIB 2, but you should be
able to find a variable that
starts with 'g' or 'grid', contains the substring 'rot', and has the
same dimensions as the data variable you are interested in.
This variable contains the vector rotation angles that allow you to
convert between vector angles relative to the
projected grid and 'earth' oriented angles. There are attributes
associated with the variable that give the formulas
needed to convert the vector values to earth-oriented (unrotated)
angles.

Here is such a variable from a GRIB 2 file:

       float gridrot_0 ( ygrid_0, xgrid_0 )
          long_name : vector rotation angle
          GridType : Rotated Latitude/Longitude
          units : radians
          formula_u : Uearth = sin(rot)*Vgrid + cos(rot)*Ugrid
          formula_v : Vearth = cos(rot)*Vgrid - sin(rot)*Ugrid
          note1 : u and v components of vector quantities are
resolved relative to grid
          note2 : apply formulas to derive u and v components
relative to earth

So I think you just need to apply the formulas first, and then
perform the interpolation.

FYI - NCL does not support writing GRIB files -- sorry about that.
  -dave

On Aug 25, 2008, at 5:16 PM, Nilsson Bengt wrote:

> Hi,
>
> I'm completely new to the NCL package and kind of desperate.
>
> My problem is that I want to 'unrotate' a rotated lat/lon grib to
> an unrotated lat/lon (with interpolation). The output should be a
> netcdf file (or even better - a new grib file), with all parameters
> from the original file.
> I've found a lot of tools that does the job for ordinary parameters
> but not for vector based parameters.
>
> In a nutshell:
>
> I would like to specify the extent and spacing of the new,
> unrotated, grib.
> Interpolate the original, rotated, grib to the new, unrotated.
> Including the wind parameters (# 33 & 34).
>
> Is this possible with help of NCL? If so, could you pls give me a
> hint, example, snippet etc. of how to do it. It's the u/v component
> that's my problem but it would be nice if the program did the whole
> job.
>
> Best regards
>
> /Bengt
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 26 2008 - 14:02:57 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 03 2008 - 11:24:29 MDT