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

Re: 20040126:gribtonc and valtime_offset



Kurt,

I understand you point of view. If/when I get a chance I'll implement
those mods.  Since I usually create most of the cdls for the users the
idea of entering the valtime_offset info into the cdl rest on me.
Also the offsets usually don't change very much, not much maintenance There
are some netcdf clients that expect the data in the monotonoc form so it's
important.

gribtocdl makes many mistakes, its purpose is to be a starting point and
then the user needs to fine tune the cdl.

For the avn 1 degree the var

 valtime_offset = 0, 6, 12, 18 ;

with dimension

valtime_offset = 4

should of worked.

I'll attach a avn one degree cdl.


Robb...


On Mon, 26 Jan 2004, Unidata Support wrote:

>
> ------- Forwarded Message
>
> >To: "'address@hidden'" <address@hidden>
> >From: "Hanson, Kurt" <address@hidden>
> >Subject: gribtonc and valtime_offset
> >Organization: UCAR/Unidata
> >Keywords: 200401261726.i0QHQlp2002589
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
> ------_=_NextPart_000_01C3E431.8ED5C2D0
> Content-Type: multipart/alternative;
>       boundary="----_=_NextPart_001_01C3E431.8ED5C2D0"
>
>
> ------_=_NextPart_001_01C3E431.8ED5C2D0
> Content-Type: text/plain;
>       charset="windows-1252"
>
> Hello --
>
> Like my previous email, the following concerns the gribtonc utility, as
> contained in version 3.0.1 of the decoders package.
>
> I stumbled upon the support email:
> http://www.unidata.ucar.edu/projects/coohl/mhonarc/MailArchives/decoders/msg
> 00544.html
>
> only after struggling to use gribtonc to convert an "AVN" grib to NetCDF.
> The grib file was a concatenation of all forecast hours for a particular run
> of the 1 degree, global GFS model. I think my problems in generating a valid
> NetCDF file were limited to the valtime_offset stumbling block referenced in
> the previous support email. It provides the tip that one should manually add
> data for the valtime_offset variable to the CDL file obtained by a run of
> gribtocdl. In my usage, I gave gribtonc a CDL file that did not define any
> values for valtime_offset, and it created output that did not have good data
> for this variable either.
>
> So I tried to "fix" gribtonc with regards to the valtime_offset issue. I
> have fix in quotes since I changed it to meet my goals, but I'm not sure if
> my solution is a universal one for all uses of gribtonc. Nonetheless, here's
> my thinking...
>
> In psuedocode, the current version of getrec(...) in recs.c does the
> following (amongst other things):
>
> ---
> if (the output file has no records)
>     initialize and write out the reftime and valtime variables based on the
> values of valtime_offset found in the CDL file
>
> if (we found the requested record)
>     return its index
>
> // else write a new record
> Append an element to the reftime array equal to the reftime function arg
> Append an element to the valtime array equal to the valtime function arg
> Compute and append a new element of the datetime array (if it exists) based
> on the htp function arg
>
> return the new record index
> ---
>
> Note that it does not append a new element to the valtime_offset variable
> when adding a new record -- after all, it assumes data already exists for
> this variable.
>
> My thinking is that whenever we need to create a new record in getrec(...),
> we can just use the htp->valoffset value we get in the htp function arg. A
> new version of getrec is attached; when it is used to overwrite the existing
> getrec(...) in recs.c, "make gribtonc" compiles successfully and the
> resulting executable seems to do as I wanted it to.
>
> My implementation no longer initializes the output variables when it finds
> no records in the output file. Instead, these variables are written on an
> as-needed basis.
>
> I suspect that the most useful version of gribtonc might handle BOTH cases
> -- when valtime_offset has data in the input CDL, and when it does not. What
> do you think?
>
> Kurt Hanson
> Scientific Software Engineer
> WSI Corporation
> 400 Minuteman Rd.
> Andover, MA 01810
>
>  <<getrec.c.20040126>>
>
>
> ------_=_NextPart_001_01C3E431.8ED5C2D0
> Content-Type: text/html;
>       charset="windows-1252"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> <HTML>
> <HEAD>
> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
> charset=3Dwindows-1252">
> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
> 5.5.2653.12">
> <TITLE>gribtonc and valtime_offset</TITLE>
> </HEAD>
> <BODY>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">Hello --</FONT>
> </P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">Like my previous email, the following =
> concerns the gribtonc utility, as contained in version 3.0.1 of the =
> decoders package.</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">I stumbled upon the support =
> email:</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial"><A =
> HREF=3D"http://www.unidata.ucar.edu/projects/coohl/mhonarc/MailArchives/=
> decoders/msg00544.html" =
> TARGET=3D"_blank">http://www.unidata.ucar.edu/projects/coohl/mhonarc/Mai=
> lArchives/decoders/msg00544.html</A></FONT>
> </P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">only after struggling to use gribtonc =
> to convert an &quot;AVN&quot; grib to NetCDF. The grib file was a =
> concatenation of all forecast hours for a particular run of the 1 =
> degree, global GFS model. I think my problems in generating a valid =
> NetCDF file were limited to the valtime_offset stumbling block =
> referenced in the previous support email. It provides the tip that one =
> should manually add data for the valtime_offset variable to the CDL =
> file obtained by a run of gribtocdl. In my usage, I gave gribtonc a CDL =
> file that did not define any values for valtime_offset, and it created =
> output that did not have good data for this variable either.</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">So I tried to &quot;fix&quot; gribtonc =
> with regards to the valtime_offset issue. I have fix in quotes since I =
> changed it to meet my goals, but I'm not sure if my solution is a =
> universal one for all uses of gribtonc. Nonetheless, here's my =
> thinking...</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">In psuedocode, the current version of =
> getrec(...) in recs.c does the following (amongst other things):</FONT>
> </P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">---</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">if (the output file has no =
> records)</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; initialize and =
> write out the reftime and valtime variables based on the values of =
> valtime_offset found in the CDL file</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">if (we found the requested =
> record)</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; return its =
> index</FONT>
> </P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">// else write a new record</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">Append an element to the reftime =
> array equal to the reftime function arg</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">Append an element to the valtime =
> array equal to the valtime function arg</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">Compute and append a new element of =
> the datetime array (if it exists) based on the htp function arg</FONT>
> </P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">return the new record index</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">---</FONT>
> </P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">Note that it does not append a new =
> element to the valtime_offset variable when adding a new record -- =
> after all, it assumes data already exists for this variable.</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">My thinking is that whenever we need =
> to create a new record in getrec(...), we can just use the =
> htp-&gt;valoffset value we get in the htp function arg. A new version =
> of getrec is attached; when it is used to overwrite the existing =
> getrec(...) in recs.c, &quot;make gribtonc&quot; compiles successfully =
> and the resulting executable seems to do as I wanted it to.</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">My implementation no longer =
> initializes the output variables when it finds no records in the output =
> file. Instead, these variables are written on an as-needed =
> basis.</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">I suspect that the most useful version =
> of gribtonc might handle BOTH cases -- when valtime_offset has data in =
> the input CDL, and when it does not. What do you think?</FONT></P>
>
> <P><FONT SIZE=3D2 FACE=3D"Arial">Kurt Hanson</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">Scientific Software Engineer</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">WSI Corporation</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">400 Minuteman Rd.</FONT>
> <BR><FONT SIZE=3D2 FACE=3D"Arial">Andover, MA 01810</FONT>
> </P>
>
> <P><FONT FACE=3D"Arial" SIZE=3D2 COLOR=3D"#000000"> =
> &lt;&lt;getrec.c.20040126&gt;&gt; </FONT>
> </P>
>
> </BODY>
> </HTML>
> ------_=_NextPart_001_01C3E431.8ED5C2D0--
>
> ------_=_NextPart_000_01C3E431.8ED5C2D0
> Content-Type: application/octet-stream;
>       name="getrec.c.20040126"
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: attachment;
>       filename="getrec.c.20040126"
>
> /*=0A=
>  * Returns record number determined by (reftime,valtime) pair.  If=0A=
>  * (reftime,valtime) is in table, returns corresponding record.  If=0A=
>  * (reftime,valtime) is not in table, increments record count, =
> enters=0A=
>  * (reftime,valtime) for new record in table, updates reftime, valtime =
> in=0A=
>  * netCDF file, updates human-comprehensible time variables in netCDF =
> file=0A=
>  * (if any), and returns record.  Returns -1 on failure.=0A=
>  */=0A=
> long=0A=
> getrec(nc, reftime, valtime, htp)=0A=
>     ncfile *nc;=0A=
>     double reftime;=0A=
>     double valtime;=0A=
>     humtime *htp;=0A=
> {=0A=
>     humtime hftp;=0A=
>     int year, month, day, hour, minute;=0A=
>     float second;=0A=
>     double *dp;=0A=
>     double *reftimes =3D nc->rt->reftimes;=0A=
>     double *valtimes =3D nc->rt->valtimes;=0A=
>     int ncid =3D nc->ncid;=0A=
>     int i;=0A=
> =0A=
>     if (nc->rt->nrecs =3D=3D 0) {=0A=
>         int nerrs =3D 0;=0A=
>         int dimvaloffsetsid;=0A=
>         long dimvaloffsets;=0A=
>         double *valoffsets;=0A=
>         utUnit valunits;=0A=
>         long start[1];=0A=
>         long count[1];=0A=
>         long ix[2];=0A=
>         long ccount[2];=0A=
>         char datetime[100];=0A=
>         char forecasttime[100];=0A=
>         char* utunitsstr;=0A=
>         int valoffsets_dim_count;=0A=
>         int valoffsets_dims[MAX_VAR_DIMS];=0A=
> =0A=
>         // Get the dimensions of the VALOFFSET variable=0A=
>         int status =3D ncvarinq(ncid,=0A=
>                               nuwg_getvar(ncid, VAR_VALOFFSET),=0A=
>                               (char *)0,=0A=
>                               (nc_type *)0,=0A=
>                               &valoffsets_dim_count,=0A=
>                               valoffsets_dims,=0A=
>                               (int *)0);=0A=
>         if (status =3D=3D -1)=0A=
>         {=0A=
>             uerror("%s: can't get dimensions of variable '%s' (status: =
> %d)",=0A=
>                    nc->ncname,=0A=
>                    nuwg_name(VAR_VALOFFSET),=0A=
>                    status);=0A=
>             nerrs++;=0A=
>             return -1;=0A=
>         }=0A=
>         else if (valoffsets_dim_count > 1)=0A=
>         {=0A=
>             uerror("%s: variable '%s' has %d dimensions but 1 is =
> expected",=0A=
>                    nc->ncname,=0A=
>                    nuwg_name(VAR_VALOFFSET),=0A=
>                    valoffsets_dim_count);=0A=
>             nerrs++;=0A=
>             return -1;=0A=
>         }=0A=
> =0A=
>         // Get the size of the VALOFFSET variable=0A=
>         dimvaloffsets =3D valoffsets_dims[0];=0A=
> =0A=
>         start[0] =3D 0;=0A=
>         count[0] =3D dimvaloffsets; =0A=
>         if (ncvarget(ncid, nc->valoffsetid, start, count,=0A=
>                      (void *)valoffsets) =3D=3D -1) {=0A=
>             uerror("%s: can't get valoffsets, ID %d",=0A=
>                nc->ncname,=0A=
>                nc->valoffsetid);=0A=
>             nerrs++;=0A=
>         }=0A=
>         if(nerrs)=0A=
>             return -1;=0A=
> =0A=
>         nc->rt->nrecs =3D dimvaloffsets;=0A=
>     }=0A=
> =0A=
>     /* First look in table of existing records */=0A=
>     for (i=3D0; i < nc->rt->nrecs; i++) {=0A=
>         if (reftime =3D=3D reftimes[i] && valtime =3D=3D =
> valtimes[i])=0A=
>             return i;=0A=
>     }=0A=
> =0A=
>     /* Didn't find it, so create a new record */=0A=
>     if (nc->rt->nrecs+1 =3D=3D nc->rt->size) {/* no room for another =
> record,=0A=
>                                              double size of table =
> before=0A=
>                                              adding */=0A=
>         nc->rt->size *=3D 2;=0A=
>         nc->rt->reftimes =3D (double *) erealloc(nc->rt->reftimes,=0A=
>                      nc->rt->size * sizeof(double));=0A=
>         nc->rt->valtimes =3D (double *) erealloc(nc->rt->valtimes,=0A=
>                      nc->rt->size * sizeof(double));=0A=
>         reftimes =3D nc->rt->reftimes;=0A=
>         valtimes =3D nc->rt->valtimes;=0A=
>     }=0A=
>     reftimes[nc->rt->nrecs] =3D reftime;=0A=
>     valtimes[nc->rt->nrecs] =3D valtime;=0A=
>                                 =0A=
>     {                                /* Update reftimes and valtimes in =
> ncfile */=0A=
>         long ix[2];=0A=
>         long count[2];=0A=
> =0A=
>         ix[0] =3D nc->rt->nrecs;=0A=
>         count[0] =3D 1;=0A=
> =0A=
>         if (ncvarput1(ncid, nc->reftimeid, ix, &reftime) =3D=3D -1 =
> ||=0A=
>             ncvarput1(ncid, nc->valtimeid, ix, &valtime) =3D=3D -1) =
> {=0A=
>             uerror("%s: failed to add new reftime, valtime", =
> nc->ncname);=0A=
>             return -1;=0A=
>         }=0A=
> =0A=
>         if(ncvarput1(ncid, nc->valoffsetid, ix, &htp->valoffset) =3D=3D =
> -1) {=0A=
>             uerror("%s: failed to add new valtime_offset", =
> nc->ncname);=0A=
>             return -1;=0A=
>         }=0A=
> =0A=
>         /* update humtime record variables, if any, from htp */=0A=
>         ix[1] =3D 0;=0A=
>         if (nc->datetimeid > 0) {=0A=
>             char datetime[100];=0A=
>             sprintf(datetime, "%.4d-%.2d-%.2d %.2d:%.2d:%.2dZ",=0A=
>                     htp->year, htp->month, htp->day,=0A=
>                     htp->hour, htp->minute, htp->second);=0A=
>             count[1] =3D strlen(datetime)+1; /* include terminating =
> null */=0A=
>             ncvarput(ncid, nc->datetimeid, ix, count, datetime);=0A=
>         }=0A=
>     }=0A=
>     nc->rt->nrecs++;=0A=
>     return nc->rt->nrecs-1;=0A=
> }=0A=
>
> ------_=_NextPart_000_01C3E431.8ED5C2D0--
>
> NOTE: All email exchanges with Unidata User Support are recorded in the
> Unidata inquiry tracking system and then made publically available
> through the web.  If you do not want to have your interactions made
> available in this way, you must let us know in each email you send to us.
> --
>
> ------- 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 {  // GFS 1 degree grid


dimensions:
        record = UNLIMITED ;   // (reference time, forecast time)
        lat = 181 ;             // latitude
        lon = 360 ;             // longitude
        level = 26 ;           // isobaric levels
        lpdg = 2 ;              // layer between levels at specif. pressure 
diffs from ground
        fh = 3 ;              // fixed height level
        pv = 2 ;              // level of specified potential vorticity
        ls = 4 ;              // layer between 2 sigma levels
        sigma = 1 ;              // sigma level
        lbls = 2 ;              // layer between 2 depths below land surface
        fhg = 2 ;              // fixed height above ground
        datetime_len = 21 ;    // string length for datetime strings
        valtime_offset = 4 ;   // 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, datetime_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, datetime_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 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 layer between levels at 
specif. pressure diffs from ground " ;
               lpdg_bot:units = "hPa" ;

        float  lpdg_top(lpdg) ;
               lpdg_top:long_name = "top level of layer between levels at 
specif. pressure diffs from ground " ;
               lpdg_top:units = "hPa" ;

        float  fh(fh) ;
               fh:long_name = "fixed height level" ;
               fh:units = "meters" ;

        float  pv(pv) ;
               pv:long_name = "level of specified potential vorticity" ;
               pv:units = "m2/kg/sec" ;

        :ls = "ls_bot, ls_top" ; // ("ls_bot, ls_top") uniquely
                                       // determines ls

        float  ls_bot(ls) ;
               ls_bot:long_name = "bottom level of layer between 2 sigma levels 
" ;
               ls_bot:units = ".01" ;

        float  ls_top(ls) ;
               ls_top:long_name = "top level of layer between 2 sigma levels " ;
               ls_top:units = ".01" ;

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

        :lbls = "lbls_bot, lbls_top" ; // ("lbls_bot, lbls_top") uniquely
                                       // determines lbls

        float  lbls_bot(lbls) ;
               lbls_bot:long_name = "bottom level of layer between 2 depths 
below land surface " ;
               lbls_bot:units = "cm" ;

        float  lbls_top(lbls) ;
               lbls_top:long_name = "top level of layer between 2 depths below 
land surface " ;
               lbls_top:units = "cm" ;

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


        // 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 levels" ;
               Z:GRIB_parameter_number = 7 ;
               Z:GRIB_level_flag = 100 ;
               Z:units = "gp m" ;
               Z:_FillValue = -9999.f ;
               Z:navigation = "nav" ;

        float  Z_pv(record,lat,lon) ;
               Z_pv:long_name = "Geopotential height at level of specified 
potential vorticity" ;
               Z_pv:GRIB_parameter_number = 7 ;
               Z_pv:GRIB_level_flag = 117 ;
               Z_pv:units = "gp m" ;
               Z_pv:_FillValue = -9999.f ;
               Z_pv: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  Z_maxwind(record,lat,lon) ;
               Z_maxwind:long_name = "Geopotential height at maximium wind 
speed level" ;
               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_sfc(lat,lon) ;
               Z_sfc:long_name = "Geopotential height at surface of the earth" ;
               Z_sfc:GRIB_parameter_number = 7 ;
               Z_sfc:GRIB_level_flag = 1 ;
               Z_sfc:units = "gp m" ;
               Z_sfc:_FillValue = -9999.f ;
               Z_sfc:navigation = "nav" ;

        float  Z_frzlvl(record,lat,lon) ;
               Z_frzlvl:long_name = "Geopotential height at 0 degree isotherm 
level" ;
               Z_frzlvl:GRIB_parameter_number = 7 ;
               Z_frzlvl:GRIB_level_flag = 4 ;
               Z_frzlvl:units = "gp m" ;
               Z_frzlvl:_FillValue = -9999.f ;
               Z_frzlvl:navigation = "nav" ;

        float  Z_htfl(record,lat,lon) ;
               Z_htfl:long_name = "Geopotential height at highest tropospheric 
freezing level" ;
               Z_htfl:GRIB_parameter_number = 7 ;
               Z_htfl:GRIB_level_flag = 204 ;
               Z_htfl:units = "gp m" ;
               Z_htfl:_FillValue = -9999.f ;
               Z_htfl:navigation = "nav" ;

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

        float  T_lpdg(record,lpdg,lat,lon) ;
               T_lpdg:long_name = "Temperature at layer between levels at 
specif. pressure diffs from ground" ;
               T_lpdg:GRIB_parameter_number = 11 ;
               T_lpdg:GRIB_level_flag = 116 ;
               T_lpdg:units = "degK" ;
               T_lpdg:_FillValue = -9999.f ;
               T_lpdg:navigation = "nav" ;

        float  T_fh(record,fh,lat,lon) ;
               T_fh:long_name = "Temperature at fixed height level" ;
               T_fh:GRIB_parameter_number = 11 ;
               T_fh:GRIB_level_flag = 103 ;
               T_fh:units = "degK" ;
               T_fh:_FillValue = -9999.f ;
               T_fh:navigation = "nav" ;

        float  T_pv(record,lat,lon) ;
               T_pv:long_name = "Temperature at level of specified potential 
vorticity" ;
               T_pv:GRIB_parameter_number = 11 ;
               T_pv:GRIB_level_flag = 117 ;
               T_pv:units = "degK" ;
               T_pv:_FillValue = -9999.f ;
               T_pv: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_maxwind(record,lat,lon) ;
               T_maxwind:long_name = "Temperature at maximium wind speed level" 
;
               T_maxwind:GRIB_parameter_number = 11 ;
               T_maxwind:GRIB_level_flag = 6 ;
               T_maxwind:units = "degK" ;
               T_maxwind:_FillValue = -9999.f ;
               T_maxwind:navigation = "nav" ;

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

        float  T_sfc(record,lat,lon) ;
               T_sfc:long_name = "Temperature at surface of the earth" ;
               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  T_lbls(record,lbls,lat,lon) ;
               T_lbls:long_name = "Temperature at layer between 2 depths below 
land surface" ;
               T_lbls:GRIB_parameter_number = 11 ;
               T_lbls:GRIB_level_flag = 112 ;
               T_lbls:units = "degK" ;
               T_lbls:_FillValue = -9999.f ;
               T_lbls:navigation = "nav" ;

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

        float  omega(record,level,lat,lon) ;
               omega:long_name = "Pressure vertical velocity at isobaric 
levels" ;
               omega:GRIB_parameter_number = 39 ;
               omega:GRIB_level_flag = 100 ;
               omega:units = "Pa/s" ;
               omega:_FillValue = -9999.f ;
               omega:navigation = "nav" ;

        float  omega_sigma(record,sigma,lat,lon) ;
               omega_sigma:long_name = "Pressure vertical velocity at sigma 
level" ;
               omega_sigma:GRIB_parameter_number = 39 ;
               omega_sigma:GRIB_level_flag = 107 ;
               omega_sigma:units = "Pa/s" ;
               omega_sigma:_FillValue = -9999.f ;
               omega_sigma:navigation = "nav" ;

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

        float  RH_lpdg(record,lpdg,lat,lon) ;
               RH_lpdg:long_name = "Relative humidity at layer between levels 
at specif. pressure diffs from ground" ;
               RH_lpdg:GRIB_parameter_number = 52 ;
               RH_lpdg:GRIB_level_flag = 116 ;
               RH_lpdg:units = "percent" ;
               RH_lpdg:_FillValue = -9999.f ;
               RH_lpdg:navigation = "nav" ;

        float  RH_atm(record,lat,lon) ;
               RH_atm:long_name = "Relative humidity at entire atmosphere 
considered as a single layer" ;
               RH_atm:GRIB_parameter_number = 52 ;
               RH_atm:GRIB_level_flag = 200 ;
               RH_atm:units = "percent" ;
               RH_atm:_FillValue = -9999.f ;
               RH_atm:navigation = "nav" ;

        float  RH_ls(record,ls,lat,lon) ;
               RH_ls:long_name = "Relative humidity at layer between 2 sigma 
levels" ;
               RH_ls:GRIB_parameter_number = 52 ;
               RH_ls:GRIB_level_flag = 108 ;
               RH_ls:units = "percent" ;
               RH_ls:_FillValue = -9999.f ;
               RH_ls:navigation = "nav" ;

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

        float  RH_frzlvl(record,lat,lon) ;
               RH_frzlvl:long_name = "Relative humidity at 0 degree isotherm 
level" ;
               RH_frzlvl:GRIB_parameter_number = 52 ;
               RH_frzlvl:GRIB_level_flag = 4 ;
               RH_frzlvl:units = "percent" ;
               RH_frzlvl:_FillValue = -9999.f ;
               RH_frzlvl:navigation = "nav" ;

        float  RH_htfl(record,lat,lon) ;
               RH_htfl:long_name = "Relative humidity at highest tropospheric 
freezing level" ;
               RH_htfl:GRIB_parameter_number = 52 ;
               RH_htfl:GRIB_level_flag = 204 ;
               RH_htfl:units = "percent" ;
               RH_htfl:_FillValue = -9999.f ;
               RH_htfl:navigation = "nav" ;

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

        float  absvor(record,level,lat,lon) ;
               absvor:long_name = "Absolute vorticity at isobaric levels" ;
               absvor:GRIB_parameter_number = 41 ;
               absvor:GRIB_level_flag = 100 ;
               absvor:units = "1/s" ;
               absvor:_FillValue = -9999.f ;
               absvor:navigation = "nav" ;

        float  o3mr(record,level,lat,lon) ;
               o3mr:long_name = "Ozone mixing ratio at isobaric levels" ;
               o3mr:GRIB_parameter_number = 154 ;
               o3mr:GRIB_level_flag = 100 ;
               o3mr:units = "kg/kg" ;
               o3mr:_FillValue = -9999.f ;
               o3mr:navigation = "nav" ;

        float  clwmr(record,level,lat,lon) ;
               clwmr:long_name = "Cloud water at isobaric levels" ;
               clwmr:GRIB_parameter_number = 153 ;
               clwmr:GRIB_level_flag = 100 ;
               clwmr:units = "kg/kg" ;
               clwmr:_FillValue = -9999.f ;
               clwmr:navigation = "nav" ;

        float  gpt_hgt5(record,level,lat,lon) ;
               gpt_hgt5:long_name = "5-wave geopotential height at isobaric 
levels" ;
               gpt_hgt5:GRIB_parameter_number = 222 ;
               gpt_hgt5:GRIB_level_flag = 100 ;
               gpt_hgt5:units = "gp m" ;
               gpt_hgt5:_FillValue = -9999.f ;
               gpt_hgt5:navigation = "nav" ;

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

        float  u_lpdg(record,lpdg,lat,lon) ;
               u_lpdg:long_name = "u-component of wind at layer between levels 
at specif. pressure diffs from ground" ;
               u_lpdg:GRIB_parameter_number = 33 ;
               u_lpdg:GRIB_level_flag = 116 ;
               u_lpdg:units = "m/s" ;
               u_lpdg:_FillValue = -9999.f ;
               u_lpdg:navigation = "nav" ;

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

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

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

        float  u_maxwind(record,lat,lon) ;
               u_maxwind:long_name = "u-component of wind at maximium wind 
speed level" ;
               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_sigma(record,sigma,lat,lon) ;
               u_sigma:long_name = "u-component of wind at sigma level" ;
               u_sigma:GRIB_parameter_number = 33 ;
               u_sigma:GRIB_level_flag = 107 ;
               u_sigma:units = "m/s" ;
               u_sigma:_FillValue = -9999.f ;
               u_sigma:navigation = "nav" ;

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

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

        float  v_lpdg(record,lpdg,lat,lon) ;
               v_lpdg:long_name = "v-component of wind at layer between levels 
at specif. pressure diffs from ground" ;
               v_lpdg:GRIB_parameter_number = 34 ;
               v_lpdg:GRIB_level_flag = 116 ;
               v_lpdg:units = "m/s" ;
               v_lpdg:_FillValue = -9999.f ;
               v_lpdg:navigation = "nav" ;

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

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

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

        float  v_maxwind(record,lat,lon) ;
               v_maxwind:long_name = "v-component of wind at maximium wind 
speed level" ;
               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_sigma(record,sigma,lat,lon) ;
               v_sigma:long_name = "v-component of wind at sigma level" ;
               v_sigma:GRIB_parameter_number = 34 ;
               v_sigma:GRIB_level_flag = 107 ;
               v_sigma:units = "m/s" ;
               v_sigma:_FillValue = -9999.f ;
               v_sigma:navigation = "nav" ;

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

        float  spec_hum_lpdg(record,lpdg,lat,lon) ;
               spec_hum_lpdg:long_name = "Specific humidity at layer between 
levels at specif. pressure diffs from ground" ;
               spec_hum_lpdg:GRIB_parameter_number = 51 ;
               spec_hum_lpdg:GRIB_level_flag = 116 ;
               spec_hum_lpdg:units = "kg/kg" ;
               spec_hum_lpdg:_FillValue = -9999.f ;
               spec_hum_lpdg:navigation = "nav" ;

        float  spec_hum_fhg(record,fhg,lat,lon) ;
               spec_hum_fhg:long_name = "Specific humidity at fixed height 
above ground" ;
               spec_hum_fhg:GRIB_parameter_number = 51 ;
               spec_hum_fhg:GRIB_level_flag = 105 ;
               spec_hum_fhg:units = "kg/kg" ;
               spec_hum_fhg:_FillValue = -9999.f ;
               spec_hum_fhg:navigation = "nav" ;

        float  P_pv(record,lat,lon) ;
               P_pv:long_name = "Pressure at level of specified potential 
vorticity" ;
               P_pv:GRIB_parameter_number = 1 ;
               P_pv:GRIB_level_flag = 117 ;
               P_pv:units = "Pa" ;
               P_pv:_FillValue = -9999.f ;
               P_pv:navigation = "nav" ;

        float  P_sfc(record,lat,lon) ;
               P_sfc:long_name = "Pressure at surface of the earth" ;
               P_sfc:GRIB_parameter_number = 1 ;
               P_sfc:GRIB_level_flag = 1 ;
               P_sfc:units = "Pa" ;
               P_sfc:_FillValue = -9999.f ;
               P_sfc:navigation = "nav" ;

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

        float  P_maxwind(record,lat,lon) ;
               P_maxwind:long_name = "Pressure at maximium wind speed level" ;
               P_maxwind:GRIB_parameter_number = 1 ;
               P_maxwind:GRIB_level_flag = 6 ;
               P_maxwind:units = "Pa" ;
               P_maxwind:_FillValue = -9999.f ;
               P_maxwind:navigation = "nav" ;

        float  P_cctl(record,lat,lon) ;
               P_cctl:long_name = "Pressure at convective cloud top height" ;
               P_cctl:GRIB_parameter_number = 1 ;
               P_cctl:GRIB_level_flag = 243 ;
               P_cctl:units = "Pa" ;
               P_cctl:_FillValue = -9999.f ;
               P_cctl:navigation = "nav" ;

        float  P_ccbl(record,lat,lon) ;
               P_ccbl:long_name = "Pressure at convective cloud bottom height" ;
               P_ccbl:GRIB_parameter_number = 1 ;
               P_ccbl:GRIB_level_flag = 242 ;
               P_ccbl:units = "Pa" ;
               P_ccbl:_FillValue = -9999.f ;
               P_ccbl:navigation = "nav" ;

        float  vert_sshr_pv(record,lat,lon) ;
               vert_sshr_pv:long_name = "Vertical speed shear at level of 
specified potential vorticity" ;
               vert_sshr_pv:GRIB_parameter_number = 136 ;
               vert_sshr_pv:GRIB_level_flag = 117 ;
               vert_sshr_pv:units = "1/s" ;
               vert_sshr_pv:_FillValue = -9999.f ;
               vert_sshr_pv:navigation = "nav" ;

        float  vert_sshr_trop(record,lat,lon) ;
               vert_sshr_trop:long_name = "Vertical speed shear at tropopause" ;
               vert_sshr_trop:GRIB_parameter_number = 136 ;
               vert_sshr_trop:GRIB_level_flag = 7 ;
               vert_sshr_trop:units = "1/s" ;
               vert_sshr_trop:_FillValue = -9999.f ;
               vert_sshr_trop:navigation = "nav" ;

        float  pr_water_atm(record,lat,lon) ;
               pr_water_atm:long_name = "Precipitable water at entire 
atmosphere considered as a single layer" ;
               pr_water_atm:GRIB_parameter_number = 54 ;
               pr_water_atm:GRIB_level_flag = 200 ;
               pr_water_atm:units = "kg/m2" ;
               pr_water_atm:_FillValue = -9999.f ;
               pr_water_atm:navigation = "nav" ;

        float  LI(record,lat,lon) ;
               LI:long_name = "Surface lifted index at surface of the earth" ;
               LI:GRIB_parameter_number = 131 ;
               LI:GRIB_level_flag = 1 ;
               LI:units = "degK" ;
               LI:_FillValue = -9999.f ;
               LI:navigation = "nav" ;

        float  cape_sfc(record,lat,lon) ;
               cape_sfc:long_name = "Convective available potential energy at 
surface of the earth" ;
               cape_sfc:GRIB_parameter_number = 157 ;
               cape_sfc:GRIB_level_flag = 1 ;
               cape_sfc:units = "J/kg" ;
               cape_sfc:_FillValue = -9999.f ;
               cape_sfc:navigation = "nav" ;

        float  cape_lpdg(record,lpdg,lat,lon) ;
               cape_lpdg:long_name = "Convective available potential energy at 
layer between levels at specif. pressure diffs from ground" ;
               cape_lpdg:GRIB_parameter_number = 157 ;
               cape_lpdg:GRIB_level_flag = 116 ;
               cape_lpdg:units = "J/kg" ;
               cape_lpdg:_FillValue = -9999.f ;
               cape_lpdg:navigation = "nav" ;

        float  cin_sfc(record,lat,lon) ;
               cin_sfc:long_name = "Convective inhibition at surface of the 
earth" ;
               cin_sfc:GRIB_parameter_number = 156 ;
               cin_sfc:GRIB_level_flag = 1 ;
               cin_sfc:units = "J/kg" ;
               cin_sfc:_FillValue = -9999.f ;
               cin_sfc:navigation = "nav" ;

        float  cin_lpdg(record,lpdg,lat,lon) ;
               cin_lpdg:long_name = "Convective inhibition at layer between 
levels at specif. pressure diffs from ground" ;
               cin_lpdg:GRIB_parameter_number = 156 ;
               cin_lpdg:GRIB_level_flag = 116 ;
               cin_lpdg:units = "J/kg" ;
               cin_lpdg:_FillValue = -9999.f ;
               cin_lpdg:navigation = "nav" ;

        float  LI4_sfc(record,lat,lon) ;
               LI4_sfc:long_name = "Best (4 layer) lifted index at surface of 
the earth" ;
               LI4_sfc:GRIB_parameter_number = 132 ;
               LI4_sfc:GRIB_level_flag = 1 ;
               LI4_sfc:units = "degK" ;
               LI4_sfc:_FillValue = -9999.f ;
               LI4_sfc:navigation = "nav" ;

        float  P_msl(record,lat,lon) ;
               P_msl:long_name = "Pressure reduced to MSL at mean sea level" ;
               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  theta_sigma(record,sigma,lat,lon) ;
               theta_sigma:long_name = "Potential temperature at sigma level" ;
               theta_sigma:GRIB_parameter_number = 13 ;
               theta_sigma:GRIB_level_flag = 107 ;
               theta_sigma:units = "degK" ;
               theta_sigma:_FillValue = -9999.f ;
               theta_sigma:navigation = "nav" ;

        float  totoz_atm(record,lat,lon) ;
               totoz_atm:long_name = "Total ozone at entire atmosphere 
considered as a single layer" ;
               totoz_atm:GRIB_parameter_number = 10 ;
               totoz_atm:GRIB_level_flag = 200 ;
               totoz_atm:units = "" ;
               totoz_atm:_FillValue = -9999.f ;
               totoz_atm:navigation = "nav" ;

        float  cloud_wat_atm(record,lat,lon) ;
               cloud_wat_atm:long_name = "Cloud water at entire atmosphere 
considered as a single layer" ;
               cloud_wat_atm:GRIB_parameter_number = 76 ;
               cloud_wat_atm:GRIB_level_flag = 200 ;
               cloud_wat_atm:units = "kg/m2" ;
               cloud_wat_atm:_FillValue = -9999.f ;
               cloud_wat_atm:navigation = "nav" ;

        float  soilw_lbls(record,lbls,lat,lon) ;
               soilw_lbls:long_name = "Volumetric soil moisture content at 
layer between 2 depths below land surface" ;
               soilw_lbls:GRIB_parameter_number = 144 ;
               soilw_lbls:GRIB_level_flag = 112 ;
               soilw_lbls:units = "" ;
               soilw_lbls:_FillValue = -9999.f ;
               soilw_lbls:navigation = "nav" ;

        float  snow_wat(record,lat,lon) ;
               snow_wat:long_name = "Water equivalent of accumulated snow depth 
at surface of the earth" ;
               snow_wat:GRIB_parameter_number = 65 ;
               snow_wat:GRIB_level_flag = 1 ;
               snow_wat:units = "kg/m2" ;
               snow_wat:_FillValue = -9999.f ;
               snow_wat:navigation = "nav" ;

        float  land_mask_sfc(record,lat,lon) ;
               land_mask_sfc:long_name = "Land-sea mask (1=land; 0=sea) at 
surface of the earth" ;
               land_mask_sfc:GRIB_parameter_number = 81 ;
               land_mask_sfc:GRIB_level_flag = 1 ;
               land_mask_sfc:units = "bit" ;
               land_mask_sfc:_FillValue = -9999.f ;
               land_mask_sfc:navigation = "nav" ;

        float  ice_conc(record,lat,lon) ;
               ice_conc:long_name = "Ice concentration (ice=l; no ice=O) at 
surface of the earth" ;
               ice_conc:GRIB_parameter_number = 91 ;
               ice_conc:GRIB_level_flag = 1 ;
               ice_conc:units = "bit" ;
               ice_conc:_FillValue = -9999.f ;
               ice_conc:navigation = "nav" ;

        float  hpbl_sfc(record,lat,lon) ;
               hpbl_sfc:long_name = "Planetary boundary layer height at surface 
of the earth" ;
               hpbl_sfc:GRIB_parameter_number = 221 ;
               hpbl_sfc:GRIB_level_flag = 1 ;
               hpbl_sfc:units = "m" ;
               hpbl_sfc:_FillValue = -9999.f ;
               hpbl_sfc:navigation = "nav" ;

        float  N_ccy(record,lat,lon) ;
               N_ccy:long_name = "Total cloud cover at convective cloud layer" ;
               N_ccy:GRIB_parameter_number = 71 ;
               N_ccy:GRIB_level_flag = 244 ;
               N_ccy:units = "percent" ;
               N_ccy:_FillValue = -9999.f ;
               N_ccy:navigation = "nav" ;

        float  Zdev(record,level,lat,lon) ;
               Zdev:long_name = "Geopotential height anomaly at isobaric 
levels" ;
               Zdev:GRIB_parameter_number = 27 ;
               Zdev:GRIB_level_flag = 100 ;
               Zdev:units = "gp m" ;
               Zdev:_FillValue = -9999.f ;
               Zdev:navigation = "nav" ;

        float  gpt_hgta5(record,level,lat,lon) ;
               gpt_hgta5:long_name = "5-wave geopotential height anomaly at 
isobaric levels" ;
               gpt_hgta5:GRIB_parameter_number = 230 ;
               gpt_hgta5:GRIB_level_flag = 100 ;
               gpt_hgta5:units = "gp m" ;
               gpt_hgta5:_FillValue = -9999.f ;
               gpt_hgta5:navigation = "nav" ;


// global attributes
               :history = "2003-07-07 12:18:04 - created by gribtocdl" ; 
               :title = "Enter model definition here" ;
               :Conventions = "NUWG" ;
               :GRIB_reference = "Office Note 388 GRIB" ;
               :GRIB_URL = "http://www.nco.ncep.noaa.gov/pmb/docs/on388/"; ;
               :version = 0.0 ;

data:

 level = 1000.0, 975.0, 950.0, 925.0, 900.0, 850.0, 800.0, 750.0, 700.0, 650.0, 
      600.0, 550.0, 500.0, 450.0, 400.0, 350.0, 300.0, 250.0, 200.0, 150.0, 
      100.0, 70.0, 50.0, 30.0, 20.0, 10.0 ;
 lpdg_bot = 0.0, 0.0 ;
 lpdg_top = 30.0, 180.0 ;
 fh = 1829.0, 2743.0, 3658.0 ;
 pv = 2.0, 32770.0 ;
 ls_bot = 100.0, 94.0, 72.0, 100.0 ;
 ls_top = 44.0, 72.0, 44.0, 33.0 ;
 sigma = 9950.0 ;
 lbls_bot = 10.0, 200.0 ;
 lbls_top = 0.0, 10.0 ;
 fhg = 2.0, 10.0 ;
 model_id = 81 ;
 valtime_offset = 0, 6, 12, 18 ;


 // Navigation
 nav_model = "GRIB1" ;
 grid_type_code = 0 ;
 grid_type = "Latitude/Longitude" ;
 grid_name = " " ;
 grid_center = 7 ;
 grid_number = 3 ;
 i_dim = "lon" ;
 j_dim = "lat" ;
 Ni = 360 ;
 Nj = 181 ;
 La1 = -90.000000 ;
 Lo1 = 0.000000 ;
 La2 = 90.000000 ;
 Lo2 = 359.000000 ;
 Di = 1.000000 ;
 Dj = 1.000000 ;
 ResCompFlag = 128 ;

 lon =  0.00,  1.00,  2.00,  3.00,  4.00,  5.00,  6.00,  7.00,
        8.00,  9.00, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00,
       16.00, 17.00, 18.00, 19.00, 20.00, 21.00, 22.00, 23.00,
       24.00, 25.00, 26.00, 27.00, 28.00, 29.00, 30.00, 31.00,
       32.00, 33.00, 34.00, 35.00, 36.00, 37.00, 38.00, 39.00,
       40.00, 41.00, 42.00, 43.00, 44.00, 45.00, 46.00, 47.00,
       48.00, 49.00, 50.00, 51.00, 52.00, 53.00, 54.00, 55.00,
       56.00, 57.00, 58.00, 59.00, 60.00, 61.00, 62.00, 63.00,
       64.00, 65.00, 66.00, 67.00, 68.00, 69.00, 70.00, 71.00,
       72.00, 73.00, 74.00, 75.00, 76.00, 77.00, 78.00, 79.00,
       80.00, 81.00, 82.00, 83.00, 84.00, 85.00, 86.00, 87.00,
       88.00, 89.00, 90.00, 91.00, 92.00, 93.00, 94.00, 95.00,
       96.00, 97.00, 98.00, 99.00,100.00,101.00,102.00,103.00,
      104.00,105.00,106.00,107.00,108.00,109.00,110.00,111.00,
      112.00,113.00,114.00,115.00,116.00,117.00,118.00,119.00,
      120.00,121.00,122.00,123.00,124.00,125.00,126.00,127.00,
      128.00,129.00,130.00,131.00,132.00,133.00,134.00,135.00,
      136.00,137.00,138.00,139.00,140.00,141.00,142.00,143.00,
      144.00,145.00,146.00,147.00,148.00,149.00,150.00,151.00,
      152.00,153.00,154.00,155.00,156.00,157.00,158.00,159.00,
      160.00,161.00,162.00,163.00,164.00,165.00,166.00,167.00,
      168.00,169.00,170.00,171.00,172.00,173.00,174.00,175.00,
      176.00,177.00,178.00,179.00,180.00,181.00,182.00,183.00,
      184.00,185.00,186.00,187.00,188.00,189.00,190.00,191.00,
      192.00,193.00,194.00,195.00,196.00,197.00,198.00,199.00,
      200.00,201.00,202.00,203.00,204.00,205.00,206.00,207.00,
      208.00,209.00,210.00,211.00,212.00,213.00,214.00,215.00,
      216.00,217.00,218.00,219.00,220.00,221.00,222.00,223.00,
      224.00,225.00,226.00,227.00,228.00,229.00,230.00,231.00,
      232.00,233.00,234.00,235.00,236.00,237.00,238.00,239.00,
      240.00,241.00,242.00,243.00,244.00,245.00,246.00,247.00,
      248.00,249.00,250.00,251.00,252.00,253.00,254.00,255.00,
      256.00,257.00,258.00,259.00,260.00,261.00,262.00,263.00,
      264.00,265.00,266.00,267.00,268.00,269.00,270.00,271.00,
      272.00,273.00,274.00,275.00,276.00,277.00,278.00,279.00,
      280.00,281.00,282.00,283.00,284.00,285.00,286.00,287.00,
      288.00,289.00,290.00,291.00,292.00,293.00,294.00,295.00,
      296.00,297.00,298.00,299.00,300.00,301.00,302.00,303.00,
      304.00,305.00,306.00,307.00,308.00,309.00,310.00,311.00,
      312.00,313.00,314.00,315.00,316.00,317.00,318.00,319.00,
      320.00,321.00,322.00,323.00,324.00,325.00,326.00,327.00,
      328.00,329.00,330.00,331.00,332.00,333.00,334.00,335.00,
      336.00,337.00,338.00,339.00,340.00,341.00,342.00,343.00,
      344.00,345.00,346.00,347.00,348.00,349.00,350.00,351.00,
      352.00,353.00,354.00,355.00,356.00,357.00,358.00,359.00 ;

 lat =-90.00,-89.00,-88.00,-87.00,-86.00,-85.00,-84.00,-83.00,
      -82.00,-81.00,-80.00,-79.00,-78.00,-77.00,-76.00,-75.00,
      -74.00,-73.00,-72.00,-71.00,-70.00,-69.00,-68.00,-67.00,
      -66.00,-65.00,-64.00,-63.00,-62.00,-61.00,-60.00,-59.00,
      -58.00,-57.00,-56.00,-55.00,-54.00,-53.00,-52.00,-51.00,
      -50.00,-49.00,-48.00,-47.00,-46.00,-45.00,-44.00,-43.00,
      -42.00,-41.00,-40.00,-39.00,-38.00,-37.00,-36.00,-35.00,
      -34.00,-33.00,-32.00,-31.00,-30.00,-29.00,-28.00,-27.00,
      -26.00,-25.00,-24.00,-23.00,-22.00,-21.00,-20.00,-19.00,
      -18.00,-17.00,-16.00,-15.00,-14.00,-13.00,-12.00,-11.00,
      -10.00, -9.00, -8.00, -7.00, -6.00, -5.00, -4.00, -3.00,
       -2.00, -1.00,  0.00,  1.00,  2.00,  3.00,  4.00,  5.00,
        6.00,  7.00,  8.00,  9.00, 10.00, 11.00, 12.00, 13.00,
       14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00, 21.00,
       22.00, 23.00, 24.00, 25.00, 26.00, 27.00, 28.00, 29.00,
       30.00, 31.00, 32.00, 33.00, 34.00, 35.00, 36.00, 37.00,
       38.00, 39.00, 40.00, 41.00, 42.00, 43.00, 44.00, 45.00,
       46.00, 47.00, 48.00, 49.00, 50.00, 51.00, 52.00, 53.00,
       54.00, 55.00, 56.00, 57.00, 58.00, 59.00, 60.00, 61.00,
       62.00, 63.00, 64.00, 65.00, 66.00, 67.00, 68.00, 69.00,
       70.00, 71.00, 72.00, 73.00, 74.00, 75.00, 76.00, 77.00,
       78.00, 79.00, 80.00, 81.00, 82.00, 83.00, 84.00, 85.00,
       86.00, 87.00, 88.00, 89.00, 90.00 ;

}