diff --git a/src/eccodes.c b/src/eccodes.c index 425a9a035..a7984b396 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -399,6 +399,7 @@ int codes_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, { return grib_set_bytes(h, key, bytes, length); } + int codes_set_double_array(grib_handle* h, const char* key, const double* vals, size_t length) { return grib_set_double_array(h, key, vals, length); @@ -407,6 +408,15 @@ int codes_set_force_double_array(grib_handle* h, const char* key, const double* { return grib_set_force_double_array(h, key, vals, length); } +int codes_set_float_array(grib_handle* h, const char* key, const float* vals, size_t length) +{ + return grib_set_float_array(h, key, vals, length); +} +int codes_set_force_float_array(grib_handle* h, const char* key, const float* vals, size_t length) +{ + return grib_set_force_float_array(h, key, vals, length); +} + int codes_set_long_array(grib_handle* h, const char* key, const long* vals, size_t length) { return grib_set_long_array(h, key, vals, length); diff --git a/src/eccodes.h b/src/eccodes.h index e90a4a398..c9beb47ca 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -930,12 +930,14 @@ int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes * @return 0 if OK, integer value on error */ int codes_set_double_array(codes_handle* h, const char* key, const double* vals, size_t length); +int codes_set_float_array(codes_handle* h, const char* key, const float* vals, size_t length); /** * Same as codes_set_double_array but allows setting of READ-ONLY keys like codedValues. * Use with great caution!! */ int codes_set_force_double_array(codes_handle* h, const char* key, const double* vals, size_t length); +int codes_set_force_float_array(codes_handle* h, const char* key, const float* vals, size_t length); /** diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 8a33d6075..ac0793765 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1235,6 +1235,9 @@ int grib_set_flag(grib_handle* h, const char* name, unsigned long flag); int grib_set_double_array_internal(grib_handle* h, const char* name, const double* val, size_t length); int grib_set_force_double_array(grib_handle* h, const char* name, const double* val, size_t length); int grib_set_double_array(grib_handle* h, const char* name, const double* val, size_t length); +int grib_set_float_array_internal(grib_handle* h, const char* name, const float* val, size_t length); +int grib_set_force_float_array(grib_handle* h, const char* name, const float* val, size_t length); +int grib_set_float_array(grib_handle* h, const char* name, const float* val, size_t length); int grib_set_long_array_internal(grib_handle* h, const char* name, const long* val, size_t length); int grib_set_long_array(grib_handle* h, const char* name, const long* val, size_t length); int grib_get_long_internal(grib_handle* h, const char* name, long* val); diff --git a/src/grib_api.h b/src/grib_api.h index b005771d0..82d10f092 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -945,12 +945,14 @@ int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, * @return 0 if OK, integer value on error */ int grib_set_double_array(grib_handle* h, const char* key, const double* vals, size_t length); +int grib_set_float_array(grib_handle* h, const char* key, const float* vals, size_t length); /** * Same as grib_set_double_array but allows setting of READ-ONLY keys like codedValues. * Use with great caution!! */ int grib_set_force_double_array(grib_handle* h, const char* key, const double* vals, size_t length); +int grib_set_force_float_array(grib_handle* h, const char* key, const float* vals, size_t length); /** diff --git a/src/grib_value.c b/src/grib_value.c index 4ff36ad2c..80d30749d 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -779,6 +779,10 @@ int grib_set_double_array_internal(grib_handle* h, const char* name, const doubl /*if (h->context->debug) fprintf(stderr,"ECCODES DEBUG grib_set_double_array_internal key=%s --DONE\n",name);*/ return ret; } +int grib_set_float_array_internal(grib_handle* h, const char* name, const float* val, size_t length) +{ + return GRIB_NOT_IMPLEMENTED; +} static int __grib_set_double_array(grib_handle* h, const char* name, const double* val, size_t length, int check) { @@ -852,11 +856,23 @@ int grib_set_force_double_array(grib_handle* h, const char* name, const double* /* Use with great caution!! */ return __grib_set_double_array(h, name, val, length, /*check=*/0); } +int grib_set_force_float_array(grib_handle* h, const char* name, const float* val, size_t length) +{ + /* GRIB-285: Same as grib_set_float_array but allows setting of READ-ONLY keys like codedValues */ + /* Use with great caution!! */ + //return __grib_set_double_array(h, name, val, length, /*check=*/0); + return GRIB_NOT_IMPLEMENTED; +} int grib_set_double_array(grib_handle* h, const char* name, const double* val, size_t length) { return __grib_set_double_array(h, name, val, length, /*check=*/1); } +int grib_set_float_array(grib_handle* h, const char* name, const float* val, size_t length) +{ + //return __grib_set_double_array(h, name, val, length, /*check=*/1); + return GRIB_NOT_IMPLEMENTED; +} static int _grib_set_long_array_internal(grib_handle* h, grib_accessor* a, const long* val, size_t buffer_len, size_t* encoded_length, int check) {