Show step info on warning/error
@@ -2186,6 +2186,8 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max
grib_context* ctx = h->context;
int is_error = 1;
char description[1024] = {0,};
+ char step[32] = "unknown";
+ size_t len = 32;
/*
* If grib_data_quality_checks == 1, limits failure results in an error
* If grib_data_quality_checks == 2, limits failure results in a warning
@@ -2213,14 +2215,15 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max
}
if (min_val < min_field_value_allowed) {
+ grib_get_string(h, "step", step, &len);
if (get_concept_condition_string(h, "param_value_min", NULL, description) == GRIB_SUCCESS) {
- fprintf(stderr, "ECCODES %s : (%s): minimum (%g) is less than the allowable limit (%g)\n",
- (is_error ? "ERROR" : "WARNING"), description, min_val, min_field_value_allowed);
+ fprintf(stderr, "ECCODES %s : (%s, step=%s): minimum (%g) is less than the allowable limit (%g)\n",
+ (is_error ? "ERROR" : "WARNING"), description, step, min_val, min_field_value_allowed);
}
else {
if (grib_get_long(h, "paramId", &paramId) == GRIB_SUCCESS) {
- fprintf(stderr, "ECCODES %s : (paramId=%ld): minimum (%g) is less than the default allowable limit (%g)\n",
- (is_error ? "ERROR" : "WARNING"), paramId, min_val, min_field_value_allowed);
+ fprintf(stderr, "ECCODES %s : (paramId=%ld, step=%s): minimum (%g) is less than the default allowable limit (%g)\n",
+ (is_error ? "ERROR" : "WARNING"), paramId, step, min_val, min_field_value_allowed);
}
}
if (is_error) {
@@ -2228,14 +2231,15 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max
}
}
if (max_val > max_field_value_allowed) {
+ grib_get_string(h, "step", step, &len);
if (get_concept_condition_string(h, "param_value_max", NULL, description) == GRIB_SUCCESS) {
- fprintf(stderr, "ECCODES %s : (%s): maximum (%g) is more than the allowable limit (%g)\n",
- (is_error ? "ERROR" : "WARNING"), description, max_val, max_field_value_allowed);
+ fprintf(stderr, "ECCODES %s : (%s, step=%s): maximum (%g) is more than the allowable limit (%g)\n",
+ (is_error ? "ERROR" : "WARNING"), description, step, max_val, max_field_value_allowed);
}
else {
if (grib_get_long(h, "paramId", &paramId) == GRIB_SUCCESS) {
- fprintf(stderr, "ECCODES %s : (paramId=%ld): maximum (%g) is more than the default allowable limit (%g)\n",
- (is_error ? "ERROR" : "WARNING"), paramId, max_val, max_field_value_allowed);
+ fprintf(stderr, "ECCODES %s : (paramId=%ld, step=%s): maximum (%g) is more than the default allowable limit (%g)\n",
+ (is_error ? "ERROR" : "WARNING"), paramId, step, max_val, max_field_value_allowed);
}
}
if (is_error) {
