ECCC-MSC / libecbufr

libecbufr is a general purpose, template-oriented BUFR encoding/decoding library
Other
10 stars 7 forks source link

cannot assign value 15 to descriptor 020011 #63

Open vsouvan opened 4 years ago

vsouvan commented 4 years ago

The bufr encoder reject the value of 15 as "out of range" for the descriptor 20011. Even if 20011 is 4 bits width. The WMO 306 vI2 Code Flag document clearly specify code 15 as valid and signify "Cloud cover is indiscernible for reasons other than fog or other meteorological phenomena, or observation is not made"


Imported from Launchpad using lp2gh.

vsouvan commented 4 years ago

(by chris-beauregard) Does

bufr_value_get_int32( bv, bufr_missing_int() );

show the same issue? Because if not, it seems more like a problem of the code generator trying to blindly follow the documentation instead of realizing that "15" is just a fancy way to say "missing".

It might be necessary for the encoder to realize that all-ones is the same as bufr_missing_int() and bypass the range check.

vsouvan commented 4 years ago

(by vanh-souvanlasy) Fix committed in revision 330 of the trunk