From 9872c7e3d1a20a1fdcd0b6d7fbe84134f4280f5f Mon Sep 17 00:00:00 2001 From: shahramn Date: Tue, 17 Dec 2024 13:52:48 +0000 Subject: [PATCH] GRIB2 product template selection: probability forecasts --- src/accessor/grib_accessor_class_concept.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index c2be42de5..5da376969 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -400,12 +400,20 @@ static int grib_concept_apply(grib_accessor* a, const char* name) } } else if (STR_EQUAL(values[i].name, "sourceSinkChemicalPhysicalProcess")) { - grib_context_log(h->context, GRIB_LOG_DEBUG, "%s: Switch to chemical src/sink", __func__); + grib_context_log(h->context, GRIB_LOG_DEBUG, "%s: Switch to chemical src/sink", __func__); if (grib_set_long(h, "is_chemical_srcsink", 1) == GRIB_SUCCESS) { resubmit = true; grib_set_values(h, &values[i], 1); } } + else if (STR_EQUAL(values[i].name, "probabilityType")) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "%s: Switch to probability forecasts", __func__); + // TODO(masn): Add a new key e.g. is_probability_forecast + if (grib_set_long(h, "productDefinitionTemplateNumber", 5) == GRIB_SUCCESS) { + resubmit = true; + grib_set_values(h, &values[i], 1); + } + } } }