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

Re: gridtonc for GEM



On Thu, 2 Oct 2003, Stuart Wier wrote:

> >To: <address@hidden>
> >cc: "Peter Lewis \(COMET\)" <address@hidden>,
> >cc: "Tim Alberta" <address@hidden>
> >From: "Garry Toth" <address@hidden>
> >Subject: IDV question
> >Organization: UCAR/COMET
> >Keywords: 200310011755.h91HtIk1025833 IDV GEM
>
> Hi,
>
>     Unidata currently receives forecast files from the Canadian GEM
> regional
> model from the Canadian Meteorological Centre.  Could those data be
> converted into the correct format (netCDF??) to allow them to be
> available
> to the new IDV application?  What would be involved in doing this?
> Thanks.
>
> Garry Toth
> COMET
>

Hiya,

Yes Unidata receives the the GEM products and yes they can be converted to
netCDF files correctly.  I can't make the statement that they are viewable
with the IDV but Stu will check on it for you. Stu?

To create the GEM netCDF files one needs to use the gribtocdl program to
create the cdl then the gribtonc program create  the netCDF file. I
created a GEM.cdl that I'll attach, it should be syntacally correct but
the verbage inside the cdl probably should be corrected. If GEM.cdl works
then forget about using the gribtocdl and just configure pqact.conf for
the gribtonc.

The pqact.conf entry would be something like:

# Canadian GEM data
CMC|EXP
CMC_GEM_reg_.*_.*_([12][0-9][0-9][0-9])([0-1][0-9])([0-3][0-9])([0-2][0-9])_
(.*).grib
        PIPE    decoders/gribtonc
        etc/GEM.cdl
        data/GRIB/\1\2\3\4_\5_GEM.nc

The entry wrapped, needs corrected and checked for correct tab insertions.



One can check gribtonc on command line by a similar entry to:

gribtonc -l - GEM.cdl gem.nc < 2003100112_P18.cmcgem


Robb...

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


dimensions:
        record = UNLIMITED ;    // (reference time, forecast time)
        x = 135 ;
        y = 94 ;
        level = 9 ;
        etal = 1 ;
        datetime_len = 21 ;
        nmodels = 1 ;
        ngrids = 1 ;
        nav = 1 ;
        nav_len = 100 ;

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

        float  etal(etal) ;
               etal:long_name = "ETA level" ;
               etal:units = ".0001" ;


        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   x_dim(nav, nav_len) ;
               x_dim:long_name = "x dimension name" ;

        char   y_dim(nav, nav_len) ;
               y_dim:long_name = "y dimension name" ;

        long   Nx(nav) ;
               Nx:long_name = "number of points along x-axis" ;

        long   Ny(nav) ;
               Ny:long_name =  "number of points along y-axis" ;

        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  Lov(nav) ;
               Lov:long_name = "orientation of the grid" ;
               Lov:units = "degrees_east" ;

        float  Dx(nav) ;
               Dx:long_name = "x-direction grid length" ;
               Dx:units = "km" ;

        float  Dy(nav) ;
               Dy:long_name = "y-direction grid length" ;
               Dy:units = "km" ;

        byte   ProjFlag(nav) ;
               ProjFlag:long_name = "projection center flag" ;


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

        // end of navigation variables

        float  T_TD(record,level,y,x) ;
               T_TD:long_name = "Dew point depression (or deficit), deg. K" ;
               T_TD:units = "degK" ;
               T_TD:_FillValue = -9999.f ;
               T_TD:navigation = "nav" ;

        float  T_TD_etal(record,etal,y,x) ;
               T_TD_etal:long_name = "Dew point depression (or deficit), deg. 
K" ;
               T_TD_etal:units = "degK" ;
               T_TD_etal:_FillValue = -9999.f ;
               T_TD_etal:navigation = "nav" ;

        float  Z(record,level,y,x) ;
               Z:long_name = "Geopotential height, gpm" ;
               Z:units = "gp m" ;
               Z:_FillValue = -9999.f ;
               Z:navigation = "nav" ;

        float  N_sfc(record,y,x) ;
               N_sfc:long_name = "Total cloud cover, %" ;
               N_sfc:units = "percent" ;
               N_sfc:_FillValue = -9999.f ;
               N_sfc:navigation = "nav" ;

        float  P_sfc(record,y,x) ;
               P_sfc:long_name = "Pressure, Pa" ;
               P_sfc:units = "Pa" ;
               P_sfc:_FillValue = -9999.f ;
               P_sfc:navigation = "nav" ;

        float  P_msl(record,y,x) ;
               P_msl:long_name = "Pressure reduced to MSL, Pa" ;
               P_msl:units = "Pa" ;
               P_msl:_FillValue = -9999.f ;
               P_msl:navigation = "nav" ;

        float  PRECIP(record,y,x) ;
               PRECIP:long_name = "Total precipitation, kg/m2" ;
               PRECIP:units = "kg/m2" ;
               PRECIP:_FillValue = -9999.f ;
               PRECIP:navigation = "nav" ;

        float  precip_rt(record,y,x) ;
               precip_rt:long_name = "Precipitation rate, kg/m2/s" ;
               precip_rt:units = "kg/(m2 s)" ;
               precip_rt:_FillValue = -9999.f ;
               precip_rt:navigation = "nav" ;

        float  T(record,level,y,x) ;
               T:long_name = "Temperature, deg. K" ;
               T:units = "degK" ;
               T:_FillValue = -9999.f ;
               T:navigation = "nav" ;

        float  T_etal(record,etal,y,x) ;
               T_etal:long_name = "Temperature, deg. K" ;
               T_etal:units = "degK" ;
               T_etal:_FillValue = -9999.f ;
               T_etal:navigation = "nav" ;

        float  u(record,level,y,x) ;
               u:long_name = "u-component of wind, m/s" ;
               u:units = "m/s" ;
               u:_FillValue = -9999.f ;
               u:navigation = "nav" ;

        float  u_etal(record,etal,y,x) ;
               u_etal:long_name = "u-component of wind, m/s" ;
               u_etal:units = "m/s" ;
               u_etal:_FillValue = -9999.f ;
               u_etal:navigation = "nav" ;

        float  v(record,level,y,x) ;
               v:long_name = "v-component of wind, m/s" ;
               v:units = "m/s" ;
               v:_FillValue = -9999.f ;
               v:navigation = "nav" ;

        float  v_etal(record,etal,y,x) ;
               v_etal:long_name = "v-component of wind, m/s" ;
               v_etal:units = "m/s" ;
               v_etal:_FillValue = -9999.f ;
               v_etal:navigation = "nav" ;

        float  omega(record,level,y,x) ;
               omega:long_name = "Pressure Vertical velocity, Pa/s" ;
               omega:units = "Pa/s" ;
               omega:_FillValue = -9999.f ;
               omega:navigation = "nav" ;


// global attributes
               :history = "2003-10-02 09:13:57 - created by gribtocdl 1.4 - 
12.12.2002" ; 
               :title = "2003100112_P18.cmcgem" ;
               :Conventions = "NUWG" ;
               :version = 0.0 ;

data:

 level = 1000.0, 925.0, 850.0, 700.0, 500.0, 400.0, 250.0, 150.0, 100.0 ;
 etal = 10000.0 ;
 model_id = 36 ;

 // Navigation
 nav_model = "GRIB1" ;
 grid_type_code = 5 ;
 grid_type = "Polar stereographic projection" ;
 grid_name = " " ;
 grid_center = 54 ;
 grid_number = 255 ;
 x_dim = "x" ;
 y_dim = "y" ;
 Nx = 135 ;
 Ny = 94 ;
 La1 = 27.202999 ;
 Lo1 = -135.212997 ;
 Lov = 249.000000 ;
 Dx = 60000.000000 ;
 Dy = 60000.000000 ;
 // Pole in proj. plane = North ;
 ProjFlag = 0 ;
 ResCompFlag = 136 ;

}