mirror of https://github.com/ecmwf/eccodes.git
Sub hourly: Dynamic native type for step, startStep and endStep for backward compatibility
This commit is contained in:
parent
12c31bbac7
commit
305f636ece
|
@ -744,15 +744,16 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len)
|
|||
|
||||
static int get_native_type(grib_accessor* a)
|
||||
{
|
||||
#if 0
|
||||
grib_handle* h = grib_handle_of_accessor(a);
|
||||
// TODO: Still experimental.
|
||||
// Change the type to depend on the stepUnits for backward compatibility
|
||||
|
||||
grib_handle* h = grib_handle_of_accessor(a);
|
||||
long step_units = 0;
|
||||
if (grib_get_long_internal(h, "stepUnits", &step_units) == GRIB_SUCCESS) {
|
||||
if (step_units == 1) {
|
||||
return GRIB_TYPE_LONG;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return GRIB_TYPE_STRING;
|
||||
}
|
||||
|
|
|
@ -349,16 +349,16 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len)
|
|||
|
||||
static int get_native_type(grib_accessor* a)
|
||||
{
|
||||
#if 0
|
||||
grib_handle* h = grib_handle_of_accessor(a);
|
||||
// TODO: Still experimental.
|
||||
// Change the type to depend on the stepUnits for backward compatibility
|
||||
|
||||
grib_handle* h = grib_handle_of_accessor(a);
|
||||
long step_units = 0;
|
||||
if (grib_get_long_internal(h, "stepUnits", &step_units) == GRIB_SUCCESS) {
|
||||
if (step_units == 1) {
|
||||
return GRIB_TYPE_LONG;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return GRIB_TYPE_STRING;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue