From a35e814154f94fd30fe2feba5517be17362c7cfd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 6 Mar 2018 13:23:57 +0000 Subject: [PATCH] Improve error message when fields are non-distinct --- tools/grib_to_netcdf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index a846a4e3a..6c8f34f4b 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -4208,8 +4208,12 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil grib_context_log(ctx, GRIB_LOG_ERROR, "Internal description"); print_all_requests(temp_data_r); } - grib_context_log(ctx, GRIB_LOG_ERROR, "Hint: This may be due to several fields having the same validity time."); - grib_context_log(ctx, GRIB_LOG_ERROR, "Try using the -T option (Do not use time of validity)"); + if (grib_options_on("T")) { + grib_context_log(ctx, GRIB_LOG_ERROR, "Hint: This may be due to several fields having the same date, time and step."); + } else { + grib_context_log(ctx, GRIB_LOG_ERROR, "Hint: This may be due to several fields having the same validity time."); + grib_context_log(ctx, GRIB_LOG_ERROR, "Try using the -T option (Do not use time of validity)"); + } exit(1); } }