Skip to content

Commit

Permalink
Fix instant ocean fields encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Aguridan committed Aug 4, 2024
1 parent 940cbff commit d03d756
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/multio/action/encode/GribEncoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,9 @@ void GribEncoder::setOceanMetadata(message::Metadata& md) {
setValue(glossary().paramId, paramInt + 4000);
}
else {
setValue(glossary().paramId, paramInt + ops_to_code.at(md.get<std::string>(glossary().operation)));
const auto operation = md.getOpt<std::string>(glossary().operation);
const auto paramIdIncrement = operation ? ops_to_code.at(*operation) : 0;
setValue(glossary().paramId, paramInt + paramIdIncrement);
}

const auto& typeOfLevel = md.get<std::string>(glossary().typeOfLevel);
Expand Down

0 comments on commit d03d756

Please sign in to comment.