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

RE: decoding the UKMET (fwd)



Charles,

the UKMET data can be decoded with the gribtonc decoder. Since it's a thin grid the program gribtocdl has problems getting the cdl correct so i created one from scratch, hopefully it's correct. it might need some minor
mods, i'll attach the cdl ukmet. This is the command line i use to decode
the data.

gribtonc -q "lin,dlat=1.5,dlon=1.5" ukmet.cdl ukmet.nc < 
UKMET_20070613_1200.grib1


Robb...



===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================

---------- Forwarded message ----------
Date: Tue, 29 May 2007 07:03:12 -0700
From: "Ross,Charles H - PGPW-5" <address@hidden>
To: address@hidden
Subject: RE: decoding the UKMET

I’m rephrasing my question…



Is anyone out there currently (successfully) decoding the UKMET model off
the Noaaport using either the gribtonc or the unidata java decoder?



Thanks for taking the time to check…



If this is the wrong forum to be asking this question, please direct me to
the proper unidata forum.  Thanks…



Charles



________________________________

From: address@hidden [mailto:address@hidden] On Behalf Of Ross,Charles H - 
PGPW-5
Sent: Wednesday, May 23, 2007 11:41 AM
To: address@hidden
Subject: decoding the UKMET



I’m having trouble creating a valid CDL (thus netCDF) for the UKMET.



Here’s my pqact.conf entry:



HDS     ^H..... EGRR ([0-3][0-9])([0-2][0-9])([0-5][0-9])

        FILE    /usr/local/models/(\1:yyyy)(\1:mm)\1\2_uk.grib





When I run a simple gribtocdl 2007052212_ukmet.grb > uk.cdl command I 
continually get this as my dimensions in the file:



dimensions:

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

        lat = 73 ;            // latitude

        lon = -1 ;            // longitude

        level = 12 ;           // isobaric levels

        time_len = 21 ;        // string length for datetime strings

        valtime_offset = 13 ;   // number of offset times

        nmodels = 4 ;          // number of models

        ngrids = 9 ;           // number of grids

        nav = 1 ;              // for navigation

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



Notice lon=-1.



Further down in the data section it tells me that:

 lon =-30.00 ;



I believe lon should equal 144 but obviously something is not working.



We take this same data and run it through the gempak decoders without a 
problem.  Anyone have any ideas what is going on with the gribtocdl program on 
this grib file?  I’ve run lots of  other model data through the gribtocdl 
program and never had a problem such as this.



Also, the java grib decoder has issues with this as well…



[ldm@metbox4 ukmet]$ java -Xmx512m ucar.nc2.iosp.grib.Grib2Netcdf 
2007052212_ukmet.grb uk_test.nc

Wed May 23 18:32:59 GMT 2007 ... Start of Grib2Netcdf

read grib file=2007052212_ukmet.grb write to netCDF file=uk_test.nc

Using default table:resources/grib/tables/wmo_2_v3.tab (74:-1:-1)

Exception in thread "main" java.lang.NullPointerException

        at ucar.nc2.Variable.setDimensions(Variable.java:1132)

        at 
ucar.nc2.NetcdfFileWriteable.addVariable(NetcdfFileWriteable.java:335)

        at ucar.nc2.FileWriter.writeToFile(FileWriter.java:158)

        at ucar.nc2.FileWriter.writeToFile(FileWriter.java:65)

        at ucar.nc2.iosp.grib.Grib2Netcdf.main(Grib2Netcdf.java:87)





Thanks for any help on this one..



Charles
netcdf ukmet{           

dimensions:
        record = UNLIMITED ;   // (reference time, forecast time)
        lat = 73 ;             // latitude
        lon = 73 ;             // longitude
        level = 11 ;           // isobaric levels
        time_len = 21 ;        // string length for datetime strings
        valtime_offset = 10 ;  // number of offset times
        nmodels = 1 ;          // number of models
        ngrids = 1 ;           // number of grids
        nav = 1 ;              // for navigation
        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, time_len) ; // derived from reftime
               datetime:long_name = "reference date and time" ;
               // units YYYY-MM-DD hh:mm:ssZ  (ISO 8601)

        double valtime_offset(valtime_offset) ; // valtime - reftime
               valtime_offset:long_name = "hours from reference time" ;
               valtime_offset:units = "hours" ;

        char   forecasttime(record, time_len) ; // derived from valtime
               forecasttime:long_name = "forecast date and time" ;
               // units YYYY-MM-DD hh:mm:ssZ  (ISO 8601)

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

        // 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" ;

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

        // 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, ngrids) ;
               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  Z(record,level,lat,lon) ;
               Z:long_name = "Geopotential height at Isobaric" ;
               Z:GRIB_parameter_number = 7 ;
               Z:GRIB_level_flag = 100 ;
               Z:units = "gp m" ;
               Z:_FillValue = -9999.f ;
               Z:navigation = "nav" ;

        float  Z_maxwind(record,lat,lon) ;
               Z_maxwind:long_name = "Geopotential height at Maximum Wind" ;
               Z_maxwind:GRIB_parameter_number = 7 ;
               Z_maxwind:GRIB_level_flag = 6 ;
               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:GRIB_parameter_number = 7 ;
               Z_trop:GRIB_level_flag = 7 ;
               Z_trop:units = "gp m" ;
               Z_trop:_FillValue = -9999.f ;
               Z_trop:navigation = "nav" ;

        float  T(record,level,lat,lon) ;
               T:long_name = "Temperature at Isobaric" ;
               T:GRIB_parameter_number = 11 ;
               T:GRIB_level_flag = 100 ;
               T:units = "degK" ;
               T:_FillValue = -9999.f ;
               T:navigation = "nav" ;

        float  T_trop(record,lat,lon) ;
               T_trop:long_name = "Temperature at Tropopause" ;
               T_trop:GRIB_parameter_number = 11 ;
               T_trop:GRIB_level_flag = 7 ;
               T_trop:units = "degK" ;
               T_trop:_FillValue = -9999.f ;
               T_trop:navigation = "nav" ;

        float  T_sfc(record,lat,lon) ;
               T_sfc:long_name = "Temperature at Surface" ;
               T_sfc:GRIB_parameter_number = 11 ;
               T_sfc:GRIB_level_flag = 1 ;
               T_sfc:units = "degK" ;
               T_sfc:_FillValue = -9999.f ;
               T_sfc:navigation = "nav" ;

        float  u(record,level,lat,lon) ;
               u:long_name = "u-component of wind at Isobaric" ;
               u:GRIB_parameter_number = 33 ;
               u:GRIB_level_flag = 100 ;
               u:units = "m/s" ;
               u:_FillValue = -9999.f ;
               u:navigation = "nav" ;

        float  u_maxwind(record,lat,lon) ;
               u_maxwind:long_name = "u-component of wind at Maximum Wind" ;
               u_maxwind:GRIB_parameter_number = 33 ;
               u_maxwind:GRIB_level_flag = 6 ;
               u_maxwind:units = "m/s" ;
               u_maxwind:_FillValue = -9999.f ;
               u_maxwind:navigation = "nav" ;

        float  u_sfc(record,lat,lon) ;
               u_sfc:long_name = "u-component of wind at Surface" ;
               u_sfc:GRIB_parameter_number = 33 ;
               u_sfc:GRIB_level_flag = 1 ;
               u_sfc:units = "m/s" ;
               u_sfc:_FillValue = -9999.f ;
               u_sfc:navigation = "nav" ;

        float  v(record,level,lat,lon) ;
               v:long_name = "v-component of wind at Isobaric" ;
               v:GRIB_parameter_number = 34 ;
               v:GRIB_level_flag = 100 ;
               v:units = "m/s" ;
               v:_FillValue = -9999.f ;
               v:navigation = "nav" ;

        float  v_maxwind(record,lat,lon) ;
               v_maxwind:long_name = "v-component of wind at Maximum Wind" ;
               v_maxwind:GRIB_parameter_number = 34 ;
               v_maxwind:GRIB_level_flag = 6 ;
               v_maxwind:units = "m/s" ;
               v_maxwind:_FillValue = -9999.f ;
               v_maxwind:navigation = "nav" ;

        float  v_sfc(record,lat,lon) ;
               v_sfc:long_name = "v-component of wind at Surface" ;
               v_sfc:GRIB_parameter_number = 34 ;
               v_sfc:GRIB_level_flag = 1 ;
               v_sfc:units = "m/s" ;
               v_sfc:_FillValue = -9999.f ;
               v_sfc:navigation = "nav" ;

        float  RH(record,level,lat,lon) ;
               RH:long_name = "Relative humidity at Isobaric" ;
               RH:GRIB_parameter_number = 52 ;
               RH:GRIB_level_flag = 100 ;
               RH:units = "percent" ;
               RH:_FillValue = -9999.f ;
               RH:navigation = "nav" ;

        float  w(record,level,lat,lon) ;
               w:long_name = "Geometric vertical velocity at Isobaric" ;
               w:GRIB_parameter_number = 40 ;
               w:GRIB_level_flag = 100 ;
               w:units = "m/s" ;
               w:_FillValue = -9999.f ;
               w:navigation = "nav" ;

        float  P_msl(record,lat,lon) ;
               P_msl:long_name = "Pressure reduced to MSL at Mean Sea" ;
               P_msl:GRIB_parameter_number = 2 ;
               P_msl:GRIB_level_flag = 102 ;
               P_msl:units = "Pa" ;
               P_msl:_FillValue = -9999.f ;
               P_msl:navigation = "nav" ;

        float  PRECIP(record,lat,lon) ;
               PRECIP:long_name = "Total precipitation at Surface" ;
               PRECIP:GRIB_parameter_number = 61 ;
               PRECIP:GRIB_level_flag = 1 ;
               PRECIP:units = "kg/m2" ;
               PRECIP:_FillValue = -9999.f ;
               PRECIP:navigation = "nav" ;


// global attributes
               :history = "2003-03-26 16:08:28 - created by gribtocdl" ; 
               :title = "126 Wave, 18 Layer Spectral Model Aviation Run" ;
               :Conventions = "NUWG" ;
               :GRIB_reference = "Office Note 388 GRIB" ;
               :GRIB_URL = "http://www.nco.ncep.noaa.gov/pmb/docs/on388/"; ;
               :version = 1.0 ;

data:

 level = 1000.0, 850.0, 700.0, 600.0, 500.0, 400.0, 300.0, 250.0, 200.0, 150.0, 
      100.0 ;
 model_id = 45 ;
 valtime_offset = 6, 12, 18, 24, 30, 36, 42, 48, 60, 72 ;


 // Navigation
 nav_model = "GRIB1" ;
 grid_type_code = 0 ;
 grid_type = "Latitude/Longitude" ;
 grid_name = "UKMET 1.5 x 1.5 degree grid" ;
 grid_center = 74 ;
 grid_number = 255 ; // from expanding thinned grids 37-44
 i_dim = "lon" ;
 j_dim = "lat" ;
 Ni = 73 ;
 Nj = 73 ;
 La1 = -90.000000 ;
 Lo1 = -30.000000 ;
 La2 = 90.000000 ;
 Lo2 = 330.000000 ;
 Di = 1.500000 ;
 Dj = 1.500000 ;
 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, 185, 190, 195, 200, 205,
        210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265,
        270, 275, 280, 285, 290, 295, 300, 305, 310, 315, 320, 325, 330 ;

 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 ;

}