Versions Compared

Key

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

...

Expand
titleClick here to see solution...

Use grib_ls to inspect the contents of the file tp.grib1, printing also the paramId with the –P option:

No Format
$> grib_ls -P paramId tp.grib1
tp.grib1
paramId      edition      centre       typeOfLevel  level        dataDate     stepRange    dataType     shortName    packingType  gridType     
142          1            ecmf         surface      0            20170221     24           fc           lsp          grid_simple  regular_ll  
1 of 1 messages in tp.grib1

1 of 1 total messages in 1 files 

Alternatively, you could inspect the parameter namesapce namespace with grib_ls:

No Format
$> grib_ls -n parameter tp.grib1
tp.grib1
centre      paramId     units       name        shortName   
ecmf        142         m           Large-scale precipitation  lsp        
1 of 1 messages in tp.grib1

1 of 1 total messages in 1 files

The shortName is set to lsp and paramId to 142, i.e., large-scale precipitation.

Info

The field was created using MARS compute to sum the convective and large-scale (stratiform) precipitation. When using MARS compute, the output field maintains the information from the GRIB header of the first input field so, in this case, we see that the field has paramId 142 even though the message is now supposed to contain the total precipitation.

To change the parameter to total precipitation, use grib_set as follows:

No Format
$> grib_set -s shortName=tp tp.grib1 tp_new.grib1

Check with grib_ls:

No Format
$> grib_ls -P paramId tp_new.grib1               
tp_new.grib1
paramId      edition      centre       typeOfLevel  level        dataDate     stepRange    dataType     shortName    packingType  gridType     
228          1            ecmf         surface      0            20170221     24           fc           tp           grid_simple  regular_ll  
1 of 1 messages in tp_new.grib1
   
1 of 1 total messages in 1 files


Tip

Note that changing the shortName has also changed the value of paramId. The same could be achieved by setting paramId=228:

No Format
$> grib_set -s paramId=228 tp.grib tp_new.grib



...