This commit is contained in:
Shahram Najm 2024-01-22 20:25:26 +00:00
parent f979f17ef3
commit 5c61344551
3 changed files with 7 additions and 3 deletions

View File

@ -63,7 +63,7 @@ int main(int argc, char* argv[])
snprintf(key, sizeof(key), "/subsetNumber=%d/blockNumber", i);
CODES_CHECK(codes_get_native_type(h, key, &ktype), 0);
//printf("Type = %d\n", ktype);
/* printf("Type = %d\n", ktype); */
printf(" subsetNumber=%d", i);
/* read and print some data values */

View File

@ -26,6 +26,9 @@ int main(int argc, char** argv)
}
/* h = codes_grib_handle_new_from_samples(NULL, "GRIB2"); */
h = codes_handle_new_from_samples(NULL, "just a test");
if (h) return 1;
h = codes_handle_new_from_samples(NULL, "GRIB2");
if (!h) {
fprintf(stderr, "Cannot create grib handle\n");

View File

@ -229,12 +229,13 @@ grib_handle* codes_handle_new_from_samples(grib_context* c, const char* name)
}
g = codes_external_template(c, PRODUCT_ANY, name);
if (!g)
if (!g) {
grib_context_log(c, GRIB_LOG_ERROR,
"Unable to load sample file '%s.tmpl'\n"
" from %s\n"
" (ecCodes Version=%s)",
name, c->grib_samples_path, ECCODES_VERSION_STR);
}
return g;
}
@ -514,7 +515,7 @@ grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const vo
memcpy(copy, data, size);
g = grib_handle_new_from_partial_message(c, copy, size);
g = grib_handle_new_from_partial_message(c, copy, size);
g->buffer->property = CODES_MY_BUFFER;
return g;