Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleClick here to see solution...

To print the mars keys, use either grib_ls -m or grib_ls -n mars.  This is the output for the file t2m.grib1:

No Format
$> grib_ls -m t2m.grib1
t2m.grib1
domain      levtype     date        time        step        param       class       type        stream      expver      
g           sfc         20170217    0000        0           167.128     od          cf          enfo        0001       
g           sfc         20170217    0000        6           167.128     od          cf          enfo        0001       
g           sfc         20170217    0000        12          167.128     od          cf          enfo        0001       
g           sfc         20170217    0000        18          167.128     od          cf          enfo        0001       
g           sfc         20170217    0000        24          167.128     od          cf          enfo        0001       
5 of 5 grib messages in t2m.grib1

5 of 5 total grib messages in 1 files 

For t2m.grib2, the same command gives:

No Format
$> grib_ls -m t2m.grib2
t2m.grib2
origin      date        time        step        levtype     number      param       expver      class       model       type        stream      
ecmf        20170217    0000        0           sfc         0           167         prod        ti          glob        cf          enfo       
ecmf        20170217    0000        6           sfc         0           167         prod        ti          glob        cf          enfo       
ecmf        20170217    0000        12          sfc         0           167         prod        ti          glob        cf          enfo       
ecmf        20170217    0000        18          sfc         0           167         prod        ti          glob        cf          enfo       
ecmf        20170217    0000        24          sfc         0           167         prod        ti          glob        cf          enfo       
5 of 5 grib messages in t2m.grib2
   
5 of 5 total grib messages in 1 files


How do you add the shortName to the output of the previous command ?

Expand
titleClick here to see solution...

To print the shortName along with the list of mars keys use the –P option e.g.:

No Format
$> grib_ls -m -P shortName t2m.grib1
t2m.grib1
shortName   domain      levtype     date        time        step        param       class       type        stream      expver      
2t          g           sfc         20170217    0000        0           167.128     od          cf          enfo        0001       
2t          g           sfc         20170217    0000        6           167.128     od          cf          enfo        0001       
2t          g           sfc         20170217    0000        12          167.128     od          cf          enfo        0001       
2t          g           sfc         20170217    0000        18          167.128     od          cf          enfo        0001       
2t          g           sfc         20170217    0000        24          167.128     od          cf          enfo        0001       
5 of 5 grib messages in t2m.grib1

5 of 5 total grib messages in 1 files


...