Commit 8bb25c8a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added patch from Nathanael

parent 6585f5f4
...@@ -67,6 +67,30 @@ static inline void *gribHandleNew(int editionNumber) ...@@ -67,6 +67,30 @@ static inline void *gribHandleNew(int editionNumber)
return gh; return gh;
} }
static inline int my_grib_set_double(grib_handle* h, const char* key, double val)
{
if ( cdiGribApiDebug )
fprintf(stderr, "grib_set_double(\tgrib_handle* h, \"%s\", %f)\n", key, val);
return grib_set_double(h, key, val);
}
static inline int my_grib_set_long(grib_handle* h, const char* key, long val)
{
if ( cdiGribApiDebug )
fprintf(stderr, "grib_set_long( \tgrib_handle* h, \"%s\", %ld)\n", key, val);
return grib_set_long(h, key, val);
}
static inline int my_grib_set_string(grib_handle* h, const char* key, const char* val, size_t* length)
{
if ( cdiGribApiDebug )
fprintf(stderr, "grib_set_string(\tgrib_handle* h, \"%s\", \"%s\")\n", key, val);
return grib_set_string(h, key, val, length);
}
static inline void gribHandleDelete(void *gh) static inline void gribHandleDelete(void *gh)
{ {
grib_handle_delete((struct grib_handle *)gh); grib_handle_delete((struct grib_handle *)gh);
......
...@@ -535,6 +535,7 @@ void cdiGribIterator_readField(CdiIterator *super, double *buffer, size_t *nmiss ...@@ -535,6 +535,7 @@ void cdiGribIterator_readField(CdiIterator *super, double *buffer, size_t *nmiss
{ {
CdiGribIterator *me = (CdiGribIterator*)super; CdiGribIterator *me = (CdiGribIterator*)super;
GRIB_CHECK(my_grib_set_double((grib_handle *)me->gribHandle, "missingValue", cdiDefaultMissval), 0);
gribGetDoubleArray((grib_handle *)me->gribHandle, "values", buffer); gribGetDoubleArray((grib_handle *)me->gribHandle, "values", buffer);
long gridType = gribGetLong((grib_handle *)me->gribHandle, "gridDefinitionTemplateNumber"); long gridType = gribGetLong((grib_handle *)me->gribHandle, "gridDefinitionTemplateNumber");
if(nmiss) if(nmiss)
......
...@@ -46,33 +46,6 @@ typedef struct { ...@@ -46,33 +46,6 @@ typedef struct {
#if defined (HAVE_LIBGRIB_API) #if defined (HAVE_LIBGRIB_API)
static
int my_grib_set_double(grib_handle* h, const char* key, double val)
{
if ( cdiGribApiDebug )
fprintf(stderr, "grib_set_double(\tgrib_handle* h, \"%s\", %f)\n", key, val);
return grib_set_double(h, key, val);
}
static
int my_grib_set_long(grib_handle* h, const char* key, long val)
{
if ( cdiGribApiDebug )
fprintf(stderr, "grib_set_long( \tgrib_handle* h, \"%s\", %ld)\n", key, val);
return grib_set_long(h, key, val);
}
static
int my_grib_set_string(grib_handle* h, const char* key, const char* val, size_t* length)
{
if ( cdiGribApiDebug )
fprintf(stderr, "grib_set_string(\tgrib_handle* h, \"%s\", \"%s\")\n", key, val);
return grib_set_string(h, key, val, length);
}
static static
int gribapiGetZaxisType(long editionNumber, int grib_ltype) int gribapiGetZaxisType(long editionNumber, int grib_ltype)
{ {
......
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