From ba915749197387464e5e66592845f4c25fc5f715 Mon Sep 17 00:00:00 2001 From: shahramn Date: Mon, 21 Oct 2024 12:46:54 +0100 Subject: [PATCH] GRIB2 product template selection: Debug messages --- src/accessor/grib_accessor_class_concept.cc | 2 ++ src/grib_value.cc | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index d3e31fc25..7c3601e6b 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -384,6 +384,7 @@ static int grib_concept_apply(grib_accessor* a, const char* name) // is instantaneous but paramId/shortName being set is for accum/avg etc if (STR_EQUAL(values[i].name, "typeOfStatisticalProcessing")) { // Switch from instantaneous to interval-based + grib_context_log(h->context, GRIB_LOG_DEBUG, "%s: Switch to statistically processed", __func__); if (grib_set_long(h, "selectStepTemplateInterval", 1) == GRIB_SUCCESS) { resubmit = true; grib_set_values(h, &values[i], 1); @@ -398,6 +399,7 @@ static int grib_concept_apply(grib_accessor* a, const char* name) } if (resubmit) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "%s: Resubmitting key/values", __func__); err = grib_set_values(h, values, count); } } diff --git a/src/grib_value.cc b/src/grib_value.cc index d323b7533..c3cf55e55 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -1801,15 +1801,15 @@ int grib_set_values_silent(grib_handle* h, grib_values* args, size_t count, int h->values[stack] = args; h->values_count[stack] = count; - for (i = 0; i < count; i++) - args[i].error = GRIB_NOT_FOUND; - if (h->context->debug) { for (i = 0; i < count; i++) { grib_print_values("ECCODES DEBUG about to set key/value pair", &args[i], stderr, 1); } } + for (i = 0; i < count; i++) + args[i].error = GRIB_NOT_FOUND; + while (more) { more = 0; for (i = 0; i < count; i++) {