Versions Compared

Key

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

...

  1. The default behaviour for grib_compare without any option is to perform a bit by bit comparison of the two messages. If the messages are found to be bitwise different then grib_compare switches to a "key based" mode to find out which coded keys are different. To see how grib_compare works we first set the shortName=2d (2 metre dew point temperature) in the file regular_latlon_surface.grib1

    Code Block
     
    > grib_set -s shortName=2d regular_latlon_surface.grib1 2d.grib1
    

    Then we can compare the two fields with grib_compare

    Code Block
    > grib_compare regular_latlon_surface.grib1 2d.grib1
     
    -- GRIB #1 -- shortName=2t paramId=167 stepRange=0 levelType=sfc level=0 packingType=grid_simple gridType=regular_ll --
    long [indicatorOfParameter]: [167] != [168]

    In the output we see that the only "coded" key with different values in the two messages is indicatorOfParameter which is the relevant key for the parameter information. The comparison can be forced to be successful listing the keys with different values in the -b option

    Code Block
    > grib_compare -b indicatorOfParameter regular_latlon_surface.grib1 2d.grib1