[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20020815: decoding Japanese Met Agency thinned grids into netCDF



On Thu, 15 Aug 2002, Unidata Support wrote:

> 
> ------- Forwarded Message
> 
> >To: address@hidden
> >From: Tony Eckel <address@hidden>
> >Subject: handling thinned grids 
> >Organization: University of Washington
> >Keywords: 200208142238.g7EMc5K14065 Japanese Met Agency thinned grids 
> >gribtonc
> 
> Hello,
> 
> I was wondering if you might know how to handle thinned lat/lon grids.
> I am trying to use gribbed global data from the Japanese Meteorological
> Agency and the data is thinned by row as you head toward the poles (to
> conserve space).  Do you have a routine that can convert such data into
> a regular lat/lon grid (i.e., fill in the thinned part), and write back
> out to either grib or NETCDF?

Tony,

Sorry for the late reply, I've been on vacation.  I don't know anything
about Japanese Met Agency thinned grids but gribtonc does work with
thinned grids. It uses the -q flag to do the interpolation of the grids, a
entry from the LDM pqact.conf file would look like this:

# AVN model on thinned grids, interpolated to global 5.0 x 2.5 regular
grid
HRS     ^H.[I-P]... KWB. (..)(..).*(/mAVN|/mSSIAVN)
        PIPE    /usr/local/ldm/decoders/gribtonc
        -q "lin,dlat=2.5,dlon=5.0" etc/avn-x.cdl
        data/GRIB/(\1:yy)(\1:mm)\1\2_avn-x.nc
   
I'll include the avn-x.cdl too.

As I stated, it depends if the grid follows the "regular" conventions,
etc.   

The decoders page is located at:

http://www.unidata.ucar.edu/packages/decoders/

You might get some hints from the Seachable archives on the page using
thinned or quasi keywords.


Robb...

> 
> Thanks for any help you can provide.
>  
> Tony Eckel
> (206)-543-9144                
> address@hidden                
> 408 Atmospheric Sciences - Geophysics Bldg
> University of Washington
> Box 351640
> Seattle, WA 98195-1640
> 
> 
> ------- End of Forwarded Message
> 
> 

===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================
netcdf avn-x {          // 126 Wave, 18 Layer Spectral Model Aviation Run
                        // on expanded quasi-regular "thinned" grids

dimensions:

        record = UNLIMITED ;    // (reference time, forecast time)
        level = 12 ;

        lat = 73 ;              // latitude
        lon = 73 ;              // longitude
        lpdg = 1 ;              // boundary layer levels
        fhg = 2 ;               // fixed height above ground levels
        sigma = 1 ;              // sigma level
        datetime_len = 21 ;     // string length for datetime strings
        nmodels = 3 ;           // both AVN and SSIAVN models
        accum = 2 ;             // time range for accumulations
        nav = 1 ;               // For navigation.  Variables that use
                                // this dimension define a mapping between
                                // (lat, lon) indices and (lat, lon) coords.

        nav_len = 100 ;         // max string length for navigation strings

variables:

        double  reftime(record) ;       // reference time of the model
                reftime:long_name = "reference time" ;
                reftime:units = "hours since 1992-1-1" ;

        double  valtime(record) ;       // forecast time ("valid" time)
                valtime:long_name = "valid time" ;
                valtime:units = "hours since 1992-1-1" ;

        :record = "reftime, valtime" ;  // "dimension attribute" -- means
                                        // (reftime, valtime) uniquely
                                        // determine record

        char    datetime(record, datetime_len) ; // derived from reftime
                datetime:long_name = "reference date and time" ;
                // units YYYY-MM-DD hh:mm:ssZ  (ISO 8601)

        float   valtime_offset(record) ; // derived as valtime-reftime
                valtime_offset:long_name = "hours from reference time" ;
                valtime_offset:units = "hours" ;

        float   level(level) ;
                level:long_name = "level" ;
                level:units = "hectopascals" ;

        :lpdg = "lpdg_bot, lpdg_top" ; // (lpdg_bot, lpdg_top) uniquely
                                       // determines lpdg
                
        float   lpdg_bot(lpdg) ;
                lpdg_bot:long_name = "bottom level of boundary layer between 2 
levels at specified pressure differences from ground to levels" ;
                lpdg_bot:units = "hectopascals" ;
                
        float   lpdg_top(lpdg) ;
                lpdg_top:long_name = "top level of boundary layer between 2 
levels at specified pressure differences from ground to levels" ;
                lpdg_top:units = "hectopascals" ;

        float   fhg(fhg) ;               // fixed height above ground
                fhg:long_name = "fixed height above ground" ;
                fhg:units = "meters" ;

        float   sigma(sigma) ;           // fixed height above ground
                sigma:long_name = "sigma level" ;
                sigma:units = "" ;       // dimensionless

        long    model_id(nmodels) ;
                model_id:long_name = "generating process ID number" ;

        // The following lat and lon coordinate variables are redundant,
        // since the navigation variables provide the necessary information.
        // The extra information is included here for human readability.

        float   lat(lat) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;

        float   lon(lon) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;

        // navigation variables all use nav dimension

        char    nav_model(nav, nav_len) ;        // navigation parameterization
                nav_model:long_name = "navigation model name" ;

        int     grid_type_code(nav) ;
                grid_type_code:long_name = "GRIB-1 GDS data representation 
type" ;

        char    grid_type(nav, nav_len) ;
                grid_type:long_name = "GRIB-1 grid type" ;

        char    grid_name(nav, nav_len) ;
                grid_name:long_name = "grid name" ;

        int     grid_center(nav) ;
                grid_center:long_name = "GRIB-1 originating center ID" ;

        int     grid_number(nav) ;
                grid_number:long_name = "GRIB-1 catalogued grid numbers" ;
                grid_number:_FillValue = -9999 ;

        char    i_dim(nav, nav_len) ;
                i_dim:long_name = "longitude dimension name" ;

        char    j_dim(nav, nav_len) ;
                j_dim:long_name = "latitude dimension name" ;

        int     Ni(nav) ;
                Ni:long_name = "number of points along a latitude circle" ;

        int     Nj(nav) ;
                Nj:long_name =  "number of points along a longitude circle" ;

        float   La1(nav) ;
                La1:long_name = "latitude of first grid point" ;
                La1:units = "degrees_north" ;

        float   Lo1(nav) ;
                Lo1:long_name = "longitude of first grid point" ;
                Lo1:units = "degrees_east" ;

        float   La2(nav) ;
                La2:long_name = "latitude of last grid point" ;
                La2:units = "degrees_north" ;

        float   Lo2(nav) ;
                Lo2:long_name = "longitude of last grid point" ;
                Lo2:units = "degrees_east" ;

        float   Di(nav) ;
                Di:long_name = "Longitudinal direction increment" ;
                Di:units = "degrees" ;

        float   Dj(nav) ;
                Dj:long_name = "Latitudinal direction increment" ;
                Dj:units = "degrees" ;

        byte    ResCompFlag(nav) ;
                ResCompFlag:long_name = "resolution and component flags" ;

        // end of navigation variables

        float   P_maxwind(record, lat, lon) ;
                P_maxwind:long_name = "pressure at maximum wind" ;
                P_maxwind:units = "Pa" ;
                P_maxwind:_FillValue = -9999.f ;
                P_maxwind:navigation = "nav" ;

        float   P_trop(record, lat, lon) ;
                P_trop:long_name = "pressure at tropopause" ;
                P_trop:units = "Pa" ;
                P_trop:_FillValue = -9999.f ;
                P_trop:navigation = "nav" ;

        float   P_msl(record, lat, lon) ;
                P_msl:long_name = "pressure reduced to MSL" ;
                P_msl:units = "Pa" ;
                P_msl:_FillValue = -9999.f ;
                P_msl:navigation = "nav" ;

        float   P_sfc(record, lat, lon) ;
                P_sfc:long_name = "pressure at surface" ;
                P_sfc:units = "Pa" ;
                P_sfc:_FillValue = -9999.f ;
                P_sfc:navigation = "nav" ;

        float   RH(record, level, lat, lon) ;
                RH:long_name = "relative humidity" ;
                RH:units = "percent" ;
                RH:_FillValue = -9999.f ;
                RH:navigation = "nav" ;

        float   T(record, level, lat, lon) ;
                T:long_name = "temperature" ;
                T:units = "degK" ;
                T:_FillValue = -9999.f ;
                T:navigation = "nav" ;

        float   T_maxwind(record, lat, lon) ;
                T_maxwind:long_name = "temperature at maxwind" ;
                T_maxwind:units = "degK" ;
                T_maxwind:_FillValue = -9999.f ;
                T_maxwind:navigation = "nav" ;

        float   T_trop(record, lat, lon) ;
                T_trop:long_name = "temperature at tropopause" ;
                T_trop:units = "degK" ;
                T_trop:_FillValue = -9999.f ;
                T_trop:navigation = "nav" ;

        float   T_sigma(record, sigma, lat, lon) ;
                T_sigma:long_name = "temperature" ;
                T_sigma:units = "degK" ;
                T_sigma:_FillValue = -9999.f ;
                T_sigma:navigation = "nav" ;

        float   Z(record, level, lat, lon) ;
                Z:long_name = "geopotential height" ;
                Z:units = "gp m" ;
                Z:_FillValue = -9999.f ;
                Z:navigation = "nav" ;  // georeference info

        float   Z_maxwind(record, lat, lon) ;
                Z_maxwind:long_name = "geopotential height at maxwind" ;
                Z_maxwind:units = "gp m" ;
                Z_maxwind:_FillValue = -9999.f ;
                Z_maxwind:navigation = "nav" ;

        float   Z_trop(record, lat, lon) ;
                Z_trop:long_name = "geopotential height at tropopause" ;
                Z_trop:units = "gp m" ;
                Z_trop:_FillValue = -9999.f ;
                Z_trop:navigation = "nav" ;

        float   T_lpdg(record, lpdg, lat, lon) ;
                T_lpdg:long_name = "temperature in boundary layer" ;
                T_lpdg:units = "degK" ;
                T_lpdg:_FillValue = -9999.f ;
                T_lpdg:navigation = "nav" ;

        float   RH_lpdg(record, lpdg, lat, lon) ;
                RH_lpdg:long_name = "relative humidity in boundary layer" ;
                RH_lpdg:units = "percent" ;
                RH_lpdg:_FillValue = -9999.f ;
                RH_lpdg:navigation = "nav" ;

        float   u_lpdg(record, lpdg, lat, lon) ;
                u_lpdg:long_name = "u-component of wind in boundary layer" ;
                u_lpdg:units = "meters/second" ;
                u_lpdg:_FillValue = -9999.f ;
                u_lpdg:navigation = "nav" ;

        float   v_lpdg(record, lpdg, lat, lon) ;
                v_lpdg:long_name = "v-component of wind in boundary layer" ;
                v_lpdg:units = "meters/second" ;
                v_lpdg:_FillValue = -9999.f ;
                v_lpdg:navigation = "nav" ;

        float   u(record, level, lat, lon) ;
                u:long_name = "u-component of wind" ;
                u:units = "meters/second" ;
                u:_FillValue = -9999.f ;
                u:navigation = "nav" ;

        float   u_maxwind(record, lat, lon) ;
                u_maxwind:long_name = "u-component of wind at max wind" ;
                u_maxwind:units = "meters/second" ;
                u_maxwind:_FillValue = -9999.f ;
                u_maxwind:navigation = "nav" ;

        float   u_trop(record, lat, lon) ;
                u_trop:long_name = "u-component of wind at tropopause" ;
                u_trop:units = "meters/second" ;
                u_trop:_FillValue = -9999.f ;
                u_trop:navigation = "nav" ;

        float   v(record, level, lat, lon) ;
                v:long_name = "v-component of wind" ;
                v:units = "meters/second" ;
                v:_FillValue = -9999.f ;
                v:navigation = "nav" ;

        float   v_maxwind(record, lat, lon) ;
                v_maxwind:long_name = "v-component of wind at max wind" ;
                v_maxwind:units = "meters/second" ;
                v_maxwind:_FillValue = -9999.f ;
                v_maxwind:navigation = "nav" ;

        float   v_trop(record, lat, lon) ;
                v_trop:long_name = "v-component of wind at tropopause" ;
                v_trop:units = "meters/second" ;
                v_trop:_FillValue = -9999.f ;
                v_trop:navigation = "nav" ;

        float   u_fhg(record, fhg, lat, lon) ;
                u_fhg:long_name = "u-component of wind at fixed height above 
ground" ;
                u_fhg:units = "meters/second" ;
                u_fhg:_FillValue = -9999.f ;
                u_fhg:navigation = "nav" ;

        float   v_fhg(record, fhg, lat, lon) ;
                v_fhg:long_name = "v-component of wind at fixed height above 
ground" ;
                v_fhg:units = "meters/second" ;
                v_fhg:_FillValue = -9999.f ;
                v_fhg:navigation = "nav" ;

        float   RH_fhg(record, fhg, lat, lon) ;
                RH_fhg:long_name = "relative humidity at fixed height above 
ground" ;
                RH_fhg:units = "percent" ;
                RH_fhg:_FillValue = -9999.f ;
                RH_fhg:navigation = "nav" ;

        float   T_fhg(record, fhg, lat, lon) ;
                T_fhg:long_name = "temperature at fixed height above ground" ;
                T_fhg:units = "degK" ;
                T_fhg:_FillValue = -9999.f ;
                T_fhg:navigation = "nav" ;

        float   PRECIP(record, lat, lon) ;
                PRECIP:long_name = "total precipitation over accumulation 
interval" ;
                PRECIP:units = "kg/m2" ;
                PRECIP:_FillValue = -9999.f ;
                PRECIP:navigation = "nav" ;

        float   PRECIP_accum_times(record, accum) ;
                PRECIP_accum_times:long_name = "precipitation accumulation 
interval" ;
                PRECIP_accum_times:units = "hours" ;
                PRECIP_accum_times:_FillValue = -9999.f ;

        float   precip_cn(record, lat, lon) ;
                precip_cn:long_name = "convective precipitation over 
accumulation interval" ;
                precip_cn:units = "kg/m2" ;
                precip_cn:_FillValue = -9999.f ;
                precip_cn:navigation = "nav" ;

        float   precip_cn_accum_times(record, accum) ;
                precip_cn_accum_times:long_name = "convective precipitation 
accumulation interval" ;
                precip_cn_accum_times:units = "hours" ;
                precip_cn_accum_times:_FillValue = -9999.f ;

        float   omega(record, level, lat, lon) ;
                omega:long_name = "pressure vertical velocity" ;
                omega:units = "Pa/s" ;
                omega:_FillValue = -9999.f ;
                omega:navigation = "nav" ;      // georeference info

        float   absvor(record, level, lat, lon) ;
                absvor:long_name = "absolute vorticity" ;
                absvor:units = "1/s" ;
                absvor:_FillValue = -9999.f ;
                absvor:navigation = "nav" ;

// global attributes:
                :history = "created by gribtonc from HRS broadcast" ;
                :title = "NMC Global Product Set" ;
                :Conventions = "NUWG" ;
                :version = 0.0 ;                // still just a draft

data:

 level = 1000, 850, 700, 600, 500, 400, 300, 250, 200, 150, 100, 70 ;
 lpdg_bot =  0 ;
 lpdg_top = 30 ;
 fhg = 2, 10 ;
 sigma = 0.9950 ;
 model_id = 77, 81, 96;

 // Navigation
 nav_model = "GRIB1" ;
 grid_type_code = 0 ;
 grid_type  = "Latitude/Longitude" ;
 grid_name = "Global 5.0 x 2.5 degree grid" ;
 grid_center = 7 ;   // NMC
 grid_number = 255 ;   // from expanding thinned grids
 i_dim = "lon" ;
 j_dim = "lat" ;
 Ni = 73 ;
 Nj = 73 ;
 La1 = -90.0 ;
 Lo1 = -30.0 ;
 La2 = 90.0 ;
 Lo2 = 240.0 ;
 Di = 5.0 ;
 Dj = 2.5 ;
 ResCompFlag = 128 ;

 lon =  -30, -25, -20, -15, -10,  -5,   0,   5,  10,  15,  20,  25,
         30,  35,  40,  45,  50,  55,  60,  65,  70,  75,  80,  85,  
         90,  95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 
        150, 155, 160, 165, 170, 175, 180,-175,-170,-165,-160,-155,
       -150,-145,-140,-135,-130,-125,-120,-115,-110,-105,-100, -95,
        -90, -85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30 ;

 lat = -90.0,-87.5,-85.0,-82.5,-80.0,-77.5,-75.0,-72.5,
       -70.0,-67.5,-65.0,-62.5,-60.0,-57.5,-55.0,-52.5,
       -50.0,-47.5,-45.0,-42.5,-40.0,-37.5,-35.0,-32.5,
       -30.0,-27.5,-25.0,-22.5,-20.0,-17.5,-15.0,-12.5,
       -10.0, -7.5, -5.0, -2.5,  0.0,  2.5,  5.0,  7.5,
        10.0, 12.5, 15.0, 17.5, 20.0, 22.5, 25.0, 27.5,
        30.0, 32.5, 35.0, 37.5, 40.0, 42.5, 45.0, 47.5,
        50.0, 52.5, 55.0, 57.5, 60.0, 62.5, 65.0, 67.5,
        70.0, 72.5, 75.0, 77.5, 80.0, 82.5, 85.0, 87.5, 90.0 ;
}