noritada/grib-rs

DWD ICON data: `DecodeError(SimplePackingDecodeError(LengthMismatch))`

crepererum opened this issue · 3 comments

Simple Description on the Bug

I'm not sure if this is a broken data file or a bug.

The DWD ICON "Total precipitation accumulated since model start" first output file crashes with a LengthMismatch error, but I think it contains an all-zero data series.

Steps to Reproduce

Get the grib file from reprod.zip (GitHub doesn't support grib files directly, hence it's packed into a ZIP). Then run:

$ cargo run -- decode icon_global_icosahedral_single-level_2021112018_000_TOT_PREC.grib2 0

You'll need #14 to prevent a panic.

Expected Behavior

The data is supposed to be the "Total precipitation accumulated since model start". This is the first output file (at model start) from the DWD ICON model, so I THINK that it's probably an all-zero data series.

Actual Behavior

It crashes with DecodeError(SimplePackingDecodeError(LengthMismatch)).

Additional Context

Data taken from https://opendata.dwd.de/weather/nwp/icon/grib/18/tot_prec/. See https://www.dwd.de/SharedDocs/downloads/DE/modelldokumentationen/nwv/icon/icon_dbbeschr_aktuell.pdf?view=nasPublication&nn=495490 for a model description.

Thank you very much for your issue report and PR submission!
I've checked that your suggestion is right.

I'm sorry. I read it wrong. #14 doesn't solve the problem by itself.

Will fix this issue later.

Thank you very much. I fixed by adding support for cases where nbit is 0.