Versions Compared

Key

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

...

Some keys are native type integer like number perturbationNumber and you can set/get them as integer, float or string as you like.

...

Code Block
% grib_set -s centre:s=ecmwf in.grib out.grib
% grib_set -s centre:i=98    in.grib out.grib

 

Some keys are concepts and they are usually strings like stepType, gridType, packingType. Again setting them as integer doesn't make any sense as they don't have any mapping as integers.

...

Conversely when you get shortName, ecCodes looks for the best match of the keys listed in the full definition of shortName (not only cape) and it is returning will return "cape" only if the following are true:

Code Block
discipline == 0
parameterCategory == 7
parameterNumber == 6
typeOfFirstFixedSurface == 1
typeOfSecondFixedSurface == 8

in the grib message and there isn't a better match of keys in the list.

...

The idea is that the user should know what to set before choosing the type to use. In the sense that the user should know the meaning of the key before setting it to a value. At For this purpose we have built the documentation and I agree that we need to do a big review (with your help) of it to fix all the wrong things and to add what is missing.

...

It is a concept like shortName and unfortunately in the previous version the native type for a concept was string even if the meaning of it is number. In the new version paramId is still a concept, but it has native type number. This means that it can be set as a number, but cannot be set as a string because only the numbers are valid values for paramId. It You can still be get it as a string because it is possible to convert a number into a string. You cannot set it as a string because it isn't always possible to convert a string into a number.

...