Commit 152e9e64 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gribapiEncode: Improved error message for optional grib keywords

parent 12a3bdf5
......@@ -3044,13 +3044,25 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
int i;
for (i=0; i<vlistptr->vars[varID].opt_grib_dbl_nentries; i++)
{
GRIB_CHECK(grib_set_double(gh, vlistptr->vars[varID].opt_grib_dbl_keyword[i],
vlistptr->vars[varID].opt_grib_dbl_val[i]), 0);
int ret = grib_set_double(gh, vlistptr->vars[varID].opt_grib_dbl_keyword[i],
vlistptr->vars[varID].opt_grib_dbl_val[i]);
if (ret != 0) {
fprintf(stderr, "key \"%s\" : value = %g\n",
vlistptr->vars[varID].opt_grib_dbl_keyword[i],
vlistptr->vars[varID].opt_grib_dbl_val[i]);
}
GRIB_CHECK(ret, 0);
}
for (i=0; i<vlistptr->vars[varID].opt_grib_int_nentries; i++)
{
GRIB_CHECK(grib_set_long(gh, vlistptr->vars[varID].opt_grib_int_keyword[i],
vlistptr->vars[varID].opt_grib_int_val[i]), 0);
int ret = grib_set_long(gh, vlistptr->vars[varID].opt_grib_int_keyword[i],
vlistptr->vars[varID].opt_grib_int_val[i]);
if (ret != 0) {
fprintf(stderr, "key \"%s\" : value = %d\n",
vlistptr->vars[varID].opt_grib_int_keyword[i],
vlistptr->vars[varID].opt_grib_int_val[i]);
}
GRIB_CHECK(ret, 0);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment