From a8e38059acb140f5f9fc81072e99666453913938 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Wed, 5 Oct 2022 10:47:57 +0100 Subject: [PATCH 001/212] creating new templates for wavelength based parameters --- definitions/grib2/template.4.108.def | 10 ++++++++++ definitions/grib2/template.4.109.def | 11 +++++++++++ definitions/grib2/template.4.110.def | 10 ++++++++++ definitions/grib2/template.4.111.def | 11 +++++++++++ 4 files changed, 42 insertions(+) create mode 100644 definitions/grib2/template.4.108.def create mode 100644 definitions/grib2/template.4.109.def create mode 100644 definitions/grib2/template.4.110.def create mode 100644 definitions/grib2/template.4.111.def diff --git a/definitions/grib2/template.4.108.def b/definitions/grib2/template.4.108.def new file mode 100644 index 000000000..df4ad830b --- /dev/null +++ b/definitions/grib2/template.4.108.def @@ -0,0 +1,10 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.108, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical properties + +include "grib2/template.4.parameter.def" +include "grib2/template.4.optical.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.point_in_time.def" +include "grib2/template.4.horizontal.def" diff --git a/definitions/grib2/template.4.109.def b/definitions/grib2/template.4.109.def new file mode 100644 index 000000000..ba75dadd6 --- /dev/null +++ b/definitions/grib2/template.4.109.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.109, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for generic optical properties + +include "grib2/template.4.parameter.def" +include "grib2/template.4.optical.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.point_in_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.eps.def" diff --git a/definitions/grib2/template.4.110.def b/definitions/grib2/template.4.110.def new file mode 100644 index 000000000..4a148ccb7 --- /dev/null +++ b/definitions/grib2/template.4.110.def @@ -0,0 +1,10 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.110 - Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties + +include "grib2/template.4.parameter.def" +include "grib2/template.4.optical.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.statistical.def" diff --git a/definitions/grib2/template.4.111.def b/definitions/grib2/template.4.111.def new file mode 100644 index 000000000..f2a63683b --- /dev/null +++ b/definitions/grib2/template.4.111.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.111, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties + +include "grib2/template.4.parameter.def" +include "grib2/template.4.optical.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.eps.def" +include "grib2/template.4.statistical.def" From 6a26e0f9dd2b7df5dbec3a5ee90a9b1a6578658f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 28 Dec 2022 20:24:15 +0000 Subject: [PATCH 002/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 01) --- src/accessor.class | 4 ++++ src/grib_accessor_class_abstract_long_vector.c | 4 ++++ src/grib_accessor_class_abstract_vector.c | 4 ++++ src/grib_accessor_class_apply_operators.c | 4 ++++ src/grib_accessor_class_array.c | 4 ++++ src/grib_accessor_class_ascii.c | 4 ++++ src/grib_accessor_class_assert.c | 4 ++++ src/grib_accessor_class_bit.c | 4 ++++ src/grib_accessor_class_bitmap.c | 4 ++++ src/grib_accessor_class_bits.c | 4 ++++ src/grib_accessor_class_bits_per_value.c | 4 ++++ src/grib_accessor_class_blob.c | 4 ++++ src/grib_accessor_class_box.c | 4 ++++ src/grib_accessor_class_budgdate.c | 4 ++++ src/grib_accessor_class_bufr_data_array.c | 5 +++++ src/grib_accessor_class_bufr_data_element.c | 4 ++++ src/grib_accessor_class_bufr_elements_table.c | 4 ++++ ...grib_accessor_class_bufr_extract_area_subsets.c | 4 ++++ ..._accessor_class_bufr_extract_datetime_subsets.c | 4 ++++ src/grib_accessor_class_bufr_extract_subsets.c | 4 ++++ src/grib_accessor_class_bufr_group.c | 4 ++++ src/grib_accessor_class_bufr_simple_thinning.c | 4 ++++ src/grib_accessor_class_bufr_string_values.c | 4 ++++ ...ib_accessor_class_bufrdc_expanded_descriptors.c | 4 ++++ src/grib_accessor_class_bytes.c | 4 ++++ ...ccessor_class_change_alternative_row_scanning.c | 4 ++++ ...grib_accessor_class_change_scanning_direction.c | 4 ++++ src/grib_accessor_class_check_internal_version.c | 4 ++++ src/grib_accessor_class_closest_date.c | 4 ++++ src/grib_accessor_class_codeflag.c | 4 ++++ src/grib_accessor_class_codetable.c | 4 ++++ src/grib_accessor_class_codetable_title.c | 4 ++++ src/grib_accessor_class_codetable_units.c | 4 ++++ src/grib_accessor_class_concept.c | 4 ++++ src/grib_accessor_class_constant.c | 4 ++++ src/grib_accessor_class_count_file.c | 4 ++++ src/grib_accessor_class_count_missing.c | 4 ++++ src/grib_accessor_class_count_total.c | 4 ++++ src/grib_accessor_class_data_2order_packing.c | 4 ++++ src/grib_accessor_class_data_apply_bitmap.c | 4 ++++ ...rib_accessor_class_data_apply_boustrophedonic.c | 4 ++++ ...essor_class_data_apply_boustrophedonic_bitmap.c | 4 ++++ src/grib_accessor_class_data_apply_gdsnotpresent.c | 4 ++++ src/grib_accessor_class_data_ccsds_packing.c | 4 ++++ src/grib_accessor_class_data_complex_packing.c | 4 ++++ src/grib_accessor_class_data_dummy_field.c | 4 ++++ src/grib_accessor_class_data_g1complex_packing.c | 4 ++++ ...ss_data_g1second_order_constant_width_packing.c | 4 ++++ ..._data_g1second_order_general_extended_packing.c | 4 ++++ ...sor_class_data_g1second_order_general_packing.c | 4 ++++ ..._class_data_g1second_order_row_by_row_packing.c | 4 ++++ src/grib_accessor_class_data_g1secondary_bitmap.c | 4 ++++ src/grib_accessor_class_data_g1shsimple_packing.c | 4 ++++ src/grib_accessor_class_data_g1simple_packing.c | 4 ++++ src/grib_accessor_class_data_g22order_packing.c | 4 ++++ src/grib_accessor_class_data_g2bifourier_packing.c | 4 ++++ src/grib_accessor_class_data_g2complex_packing.c | 4 ++++ src/grib_accessor_class_data_g2secondary_bitmap.c | 4 ++++ src/grib_accessor_class_data_g2shsimple_packing.c | 4 ++++ src/grib_accessor_class_data_g2simple_packing.c | 4 ++++ ...lass_data_g2simple_packing_with_preprocessing.c | 4 ++++ src/grib_accessor_class_data_jpeg2000_packing.c | 4 ++++ src/grib_accessor_class_data_png_packing.c | 4 ++++ src/grib_accessor_class_data_raw_packing.c | 4 ++++ src/grib_accessor_class_data_secondary_bitmap.c | 4 ++++ src/grib_accessor_class_data_sh_packed.c | 4 ++++ src/grib_accessor_class_data_sh_unpacked.c | 4 ++++ src/grib_accessor_class_data_shsimple_packing.c | 4 ++++ src/grib_accessor_class_data_simple_packing.c | 4 ++++ src/grib_accessor_class_decimal_precision.c | 4 ++++ src/grib_accessor_class_dictionary.c | 4 ++++ src/grib_accessor_class_dirty.c | 4 ++++ src/grib_accessor_class_divdouble.c | 4 ++++ src/grib_accessor_class_double.c | 4 ++++ src/grib_accessor_class_element.c | 4 ++++ src/grib_accessor_class_evaluate.c | 4 ++++ src/grib_accessor_class_expanded_descriptors.c | 4 ++++ src/grib_accessor_class_forward.c | 4 ++++ ...accessor_class_from_scale_factor_scaled_value.c | 4 ++++ src/grib_accessor_class_g1_half_byte_codeflag.c | 4 ++++ src/grib_accessor_class_g1_message_length.c | 4 ++++ src/grib_accessor_class_g1_section4_length.c | 4 ++++ src/grib_accessor_class_g1area.c | 4 ++++ src/grib_accessor_class_g1bitmap.c | 4 ++++ src/grib_accessor_class_g1date.c | 4 ++++ src/grib_accessor_class_g1day_of_the_year_date.c | 4 ++++ ...grib_accessor_class_g1end_of_interval_monthly.c | 4 ++++ src/grib_accessor_class_g1fcperiod.c | 4 ++++ src/grib_accessor_class_g1forecastmonth.c | 4 ++++ src/grib_accessor_class_g1monthlydate.c | 4 ++++ ...sor_class_g1number_of_coded_values_sh_complex.c | 4 ++++ ...ssor_class_g1number_of_coded_values_sh_simple.c | 4 ++++ src/grib_accessor_class_g1step_range.c | 4 ++++ src/grib_accessor_class_g1verificationdate.c | 4 ++++ src/grib_accessor_class_g2_aerosol.c | 4 ++++ src/grib_accessor_class_g2_chemical.c | 4 ++++ src/grib_accessor_class_g2_eps.c | 4 ++++ src/grib_accessor_class_g2_mars_labeling.c | 4 ++++ src/grib_accessor_class_g2bitmap.c | 4 ++++ src/grib_accessor_class_g2bitmap_present.c | 4 ++++ src/grib_accessor_class_g2date.c | 4 ++++ src/grib_accessor_class_g2end_step.c | 4 ++++ src/grib_accessor_class_g2grid.c | 4 ++++ src/grib_accessor_class_g2latlon.c | 4 ++++ src/grib_accessor_class_g2level.c | 4 ++++ src/grib_accessor_class_g2lon.c | 4 ++++ src/grib_accessor_class_g2step_range.c | 4 ++++ src/grib_accessor_class_gaussian_grid_name.c | 4 ++++ src/grib_accessor_class_gds_is_present.c | 4 ++++ src/grib_accessor_class_gds_not_present_bitmap.c | 4 ++++ src/grib_accessor_class_gen.c | 2 ++ src/grib_accessor_class_getenv.c | 4 ++++ src/grib_accessor_class_global_gaussian.c | 4 ++++ src/grib_accessor_class_group.c | 4 ++++ src/grib_accessor_class_gts_header.c | 4 ++++ src/grib_accessor_class_hash_array.c | 4 ++++ src/grib_accessor_class_headers_only.c | 4 ++++ src/grib_accessor_class_ibmfloat.c | 4 ++++ src/grib_accessor_class_ieeefloat.c | 4 ++++ src/grib_accessor_class_ifs_param.c | 4 ++++ src/grib_accessor_class_int16.c | 4 ++++ src/grib_accessor_class_int16_little_endian.c | 4 ++++ src/grib_accessor_class_int32.c | 4 ++++ src/grib_accessor_class_int32_little_endian.c | 4 ++++ src/grib_accessor_class_int64.c | 4 ++++ src/grib_accessor_class_int64_little_endian.c | 4 ++++ src/grib_accessor_class_int8.c | 4 ++++ src/grib_accessor_class_iterator.c | 4 ++++ src/grib_accessor_class_julian_date.c | 4 ++++ src/grib_accessor_class_julian_day.c | 4 ++++ src/grib_accessor_class_ksec1expver.c | 4 ++++ src/grib_accessor_class_label.c | 4 ++++ src/grib_accessor_class_laplacian.c | 4 ++++ src/grib_accessor_class_latitudes.c | 4 ++++ src/grib_accessor_class_latlon_increment.c | 4 ++++ src/grib_accessor_class_latlonvalues.c | 4 ++++ src/grib_accessor_class_library_version.c | 4 ++++ src/grib_accessor_class_local_definition.c | 4 ++++ src/grib_accessor_class_long.c | 4 ++++ src/grib_accessor_class_long_vector.c | 4 ++++ src/grib_accessor_class_longitudes.c | 4 ++++ src/grib_accessor_class_lookup.c | 4 ++++ src/grib_accessor_class_mars_param.c | 4 ++++ src/grib_accessor_class_mars_step.c | 4 ++++ src/grib_accessor_class_md5.c | 4 ++++ src/grib_accessor_class_message.c | 4 ++++ src/grib_accessor_class_message_copy.c | 4 ++++ src/grib_accessor_class_missing.c | 2 ++ src/grib_accessor_class_nearest.c | 4 ++++ src/grib_accessor_class_non_alpha.c | 4 ++++ src/grib_accessor_class_number_of_coded_values.c | 4 ++++ src/grib_accessor_class_number_of_points.c | 4 ++++ ...grib_accessor_class_number_of_points_gaussian.c | 4 ++++ src/grib_accessor_class_number_of_values.c | 4 ++++ ...essor_class_number_of_values_data_raw_packing.c | 4 ++++ src/grib_accessor_class_octahedral_gaussian.c | 4 ++++ src/grib_accessor_class_octet_number.c | 4 ++++ src/grib_accessor_class_offset_file.c | 4 ++++ src/grib_accessor_class_offset_values.c | 4 ++++ src/grib_accessor_class_pack_bufr_values.c | 4 ++++ src/grib_accessor_class_pad.c | 4 ++++ src/grib_accessor_class_padding.c | 4 ++++ src/grib_accessor_class_padto.c | 4 ++++ src/grib_accessor_class_padtoeven.c | 4 ++++ src/grib_accessor_class_padtomultiple.c | 4 ++++ src/grib_accessor_class_position.c | 4 ++++ src/grib_accessor_class_proj_string.c | 4 ++++ src/grib_accessor_class_raw.c | 4 ++++ src/grib_accessor_class_rdbtime_guess_date.c | 4 ++++ src/grib_accessor_class_reference_value_error.c | 4 ++++ src/grib_accessor_class_round.c | 4 ++++ src/grib_accessor_class_scale.c | 4 ++++ src/grib_accessor_class_scale_values.c | 4 ++++ ...ib_accessor_class_second_order_bits_per_value.c | 4 ++++ src/grib_accessor_class_section.c | 4 ++++ src/grib_accessor_class_section_length.c | 4 ++++ src/grib_accessor_class_section_padding.c | 4 ++++ src/grib_accessor_class_section_pointer.c | 4 ++++ src/grib_accessor_class_select_step_template.c | 4 ++++ src/grib_accessor_class_sexagesimal2decimal.c | 4 ++++ src/grib_accessor_class_signed.c | 4 ++++ src/grib_accessor_class_signed_bits.c | 4 ++++ src/grib_accessor_class_simple_packing_error.c | 4 ++++ src/grib_accessor_class_size.c | 4 ++++ src/grib_accessor_class_smart_table.c | 4 ++++ src/grib_accessor_class_smart_table_column.c | 4 ++++ src/grib_accessor_class_spd.c | 4 ++++ src/grib_accessor_class_spectral_truncation.c | 4 ++++ src/grib_accessor_class_sprintf.c | 4 ++++ src/grib_accessor_class_statistics.c | 4 ++++ src/grib_accessor_class_statistics_spectral.c | 4 ++++ src/grib_accessor_class_step_human_readable.c | 4 ++++ src/grib_accessor_class_step_in_units.c | 4 ++++ src/grib_accessor_class_sum.c | 4 ++++ src/grib_accessor_class_suppressed.c | 4 ++++ src/grib_accessor_class_time.c | 4 ++++ src/grib_accessor_class_times.c | 4 ++++ src/grib_accessor_class_to_double.c | 4 ++++ src/grib_accessor_class_to_integer.c | 4 ++++ src/grib_accessor_class_to_string.c | 4 ++++ src/grib_accessor_class_transient.c | 4 ++++ src/grib_accessor_class_transient_darray.c | 4 ++++ src/grib_accessor_class_trim.c | 4 ++++ src/grib_accessor_class_uint16.c | 4 ++++ src/grib_accessor_class_uint16_little_endian.c | 4 ++++ src/grib_accessor_class_uint32.c | 4 ++++ src/grib_accessor_class_uint32_little_endian.c | 4 ++++ src/grib_accessor_class_uint64.c | 4 ++++ src/grib_accessor_class_uint64_little_endian.c | 4 ++++ src/grib_accessor_class_uint8.c | 4 ++++ src/grib_accessor_class_unexpanded_descriptors.c | 4 ++++ src/grib_accessor_class_unpack_bufr_values.c | 4 ++++ src/grib_accessor_class_unsigned.c | 4 ++++ src/grib_accessor_class_unsigned_bits.c | 4 ++++ src/grib_accessor_class_validity_date.c | 4 ++++ src/grib_accessor_class_validity_time.c | 4 ++++ src/grib_accessor_class_values.c | 4 ++++ src/grib_accessor_class_variable.c | 4 ++++ src/grib_accessor_class_vector.c | 4 ++++ src/grib_accessor_class_when.c | 4 ++++ src/grib_api_internal.h | 4 ++++ src/grib_iterator_class_gaussian.c | 14 ++++++++------ src/grib_iterator_class_latlon.c | 14 ++++++++------ 223 files changed, 897 insertions(+), 12 deletions(-) diff --git a/src/accessor.class b/src/accessor.class index 697bade54..5996e2995 100644 --- a/src/accessor.class +++ b/src/accessor.class @@ -4,12 +4,14 @@ static int pack_missing(grib_accessor*); static int is_missing(grib_accessor*); static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); static int pack_double(grib_accessor*, const double* val, size_t* len); +static int pack_float(grib_accessor*, const float* val, size_t* len); static int pack_long(grib_accessor*, const long* val, size_t* len); static int pack_string(grib_accessor*, const char*, size_t* len); static int pack_string_array(grib_accessor*, const char**, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static int unpack_string_array(grib_accessor*, char**, size_t* len); @@ -66,7 +68,9 @@ static grib_accessor_class _grib_accessor_class_NAME = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + &pack_float, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ diff --git a/src/grib_accessor_class_abstract_long_vector.c b/src/grib_accessor_class_abstract_long_vector.c index 337a23f85..8914f560c 100644 --- a/src/grib_accessor_class_abstract_long_vector.c +++ b/src/grib_accessor_class_abstract_long_vector.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_abstract_long_vector = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_abstract_vector.c b/src/grib_accessor_class_abstract_vector.c index ef601c3c1..e6d771004 100644 --- a/src/grib_accessor_class_abstract_vector.c +++ b/src/grib_accessor_class_abstract_vector.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_abstract_vector = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_apply_operators.c b/src/grib_accessor_class_apply_operators.c index 2f7c9a5d3..ea3eb344b 100644 --- a/src/grib_accessor_class_apply_operators.c +++ b/src/grib_accessor_class_apply_operators.c @@ -126,7 +126,9 @@ static grib_accessor_class _grib_accessor_class_apply_operators = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -161,6 +163,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_array.c b/src/grib_accessor_class_array.c index 97e7077f9..e5df8b72d 100644 --- a/src/grib_accessor_class_array.c +++ b/src/grib_accessor_class_array.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_array = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_ascii.c b/src/grib_accessor_class_ascii.c index 985719457..465ddf8cf 100644 --- a/src/grib_accessor_class_ascii.c +++ b/src/grib_accessor_class_ascii.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_ascii = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,6 +120,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_assert.c b/src/grib_accessor_class_assert.c index 9c07fb6fe..d32716372 100644 --- a/src/grib_accessor_class_assert.c +++ b/src/grib_accessor_class_assert.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_assert = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bit.c b/src/grib_accessor_class_bit.c index 79fa43abe..5976f4eaf 100644 --- a/src/grib_accessor_class_bit.c +++ b/src/grib_accessor_class_bit.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_bit = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index 922634318..266fc937a 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_bitmap = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_bits.c b/src/grib_accessor_class_bits.c index 0257f5792..9c0487c04 100644 --- a/src/grib_accessor_class_bits.c +++ b/src/grib_accessor_class_bits.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_bits = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -132,6 +134,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_bits_per_value.c b/src/grib_accessor_class_bits_per_value.c index b040db6c3..bb18d76f4 100644 --- a/src/grib_accessor_class_bits_per_value.c +++ b/src/grib_accessor_class_bits_per_value.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_bits_per_value = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_blob.c b/src/grib_accessor_class_blob.c index 841f15209..606a1e7c1 100644 --- a/src/grib_accessor_class_blob.c +++ b/src/grib_accessor_class_blob.c @@ -68,7 +68,9 @@ static grib_accessor_class _grib_accessor_class_blob = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_box.c b/src/grib_accessor_class_box.c index 5e4c2e18b..abf19c0c2 100644 --- a/src/grib_accessor_class_box.c +++ b/src/grib_accessor_class_box.c @@ -68,7 +68,9 @@ static grib_accessor_class _grib_accessor_class_box = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -108,7 +110,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_budgdate.c b/src/grib_accessor_class_budgdate.c index b3ed12e7c..fb0da1f19 100644 --- a/src/grib_accessor_class_budgdate.c +++ b/src/grib_accessor_class_budgdate.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_budgdate = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 3ec37cf78..24a14bca4 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -64,6 +64,7 @@ MEMBERS = grib_iarray* iss_list MEMBERS = grib_trie_with_rank* dataAccessorsTrie MEMBERS = grib_sarray* tempStrings + MEMBERS = grib_vdarray* tempDoubleValues MEMBERS = int change_ref_value_operand MEMBERS = size_t refValListSize MEMBERS = long* refValList @@ -177,7 +178,9 @@ static grib_accessor_class _grib_accessor_class_bufr_data_array = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -210,6 +213,8 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_data_element.c b/src/grib_accessor_class_bufr_data_element.c index 75efd13e6..22421d12c 100644 --- a/src/grib_accessor_class_bufr_data_element.c +++ b/src/grib_accessor_class_bufr_data_element.c @@ -110,7 +110,9 @@ static grib_accessor_class _grib_accessor_class_bufr_data_element = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ @@ -143,6 +145,8 @@ static void init_class(grib_accessor_class* c) c->byte_count = (*(c->super))->byte_count; c->byte_offset = (*(c->super))->byte_offset; c->sub_section = (*(c->super))->sub_section; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_bytes = (*(c->super))->pack_bytes; c->unpack_bytes = (*(c->super))->unpack_bytes; c->pack_expression = (*(c->super))->pack_expression; diff --git a/src/grib_accessor_class_bufr_elements_table.c b/src/grib_accessor_class_bufr_elements_table.c index 41dc8f4ec..7b8462e71 100644 --- a/src/grib_accessor_class_bufr_elements_table.c +++ b/src/grib_accessor_class_bufr_elements_table.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_bufr_elements_table = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -147,6 +149,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_bufr_extract_area_subsets.c b/src/grib_accessor_class_bufr_extract_area_subsets.c index b7ef42e7b..344d1d911 100644 --- a/src/grib_accessor_class_bufr_extract_area_subsets.c +++ b/src/grib_accessor_class_bufr_extract_area_subsets.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_bufr_extract_area_subsets = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index 297030ac3..c3988781a 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -73,7 +73,9 @@ static grib_accessor_class _grib_accessor_class_bufr_extract_datetime_subsets = &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_extract_subsets.c b/src/grib_accessor_class_bufr_extract_subsets.c index de287fb04..b3b0b71ed 100644 --- a/src/grib_accessor_class_bufr_extract_subsets.c +++ b/src/grib_accessor_class_bufr_extract_subsets.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_bufr_extract_subsets = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_group.c b/src/grib_accessor_class_bufr_group.c index 84623ef97..3d5c30e3a 100644 --- a/src/grib_accessor_class_bufr_group.c +++ b/src/grib_accessor_class_bufr_group.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_bufr_group = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -111,7 +113,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_simple_thinning.c b/src/grib_accessor_class_bufr_simple_thinning.c index 4496fa263..280151846 100644 --- a/src/grib_accessor_class_bufr_simple_thinning.c +++ b/src/grib_accessor_class_bufr_simple_thinning.c @@ -79,7 +79,9 @@ static grib_accessor_class _grib_accessor_class_bufr_simple_thinning = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bufr_string_values.c b/src/grib_accessor_class_bufr_string_values.c index 93c827e16..af6a76125 100644 --- a/src/grib_accessor_class_bufr_string_values.c +++ b/src/grib_accessor_class_bufr_string_values.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_bufr_string_values = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_bytes = (*(c->super))->pack_bytes; c->unpack_bytes = (*(c->super))->unpack_bytes; c->pack_expression = (*(c->super))->pack_expression; diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.c b/src/grib_accessor_class_bufrdc_expanded_descriptors.c index b284da343..1272800c3 100644 --- a/src/grib_accessor_class_bufrdc_expanded_descriptors.c +++ b/src/grib_accessor_class_bufrdc_expanded_descriptors.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_bufrdc_expanded_descriptors = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -123,7 +125,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_bytes.c b/src/grib_accessor_class_bytes.c index 5ecf84ad0..0b6d2f0b3 100644 --- a/src/grib_accessor_class_bytes.c +++ b/src/grib_accessor_class_bytes.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_bytes = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -109,7 +111,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_change_alternative_row_scanning.c b/src/grib_accessor_class_change_alternative_row_scanning.c index a780ec82b..24bbec32e 100644 --- a/src/grib_accessor_class_change_alternative_row_scanning.c +++ b/src/grib_accessor_class_change_alternative_row_scanning.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_change_alternative_row_scanning &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_change_scanning_direction.c b/src/grib_accessor_class_change_scanning_direction.c index f7bb4a97e..d57d4d402 100644 --- a/src/grib_accessor_class_change_scanning_direction.c +++ b/src/grib_accessor_class_change_scanning_direction.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_change_scanning_direction = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -123,7 +125,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_check_internal_version.c b/src/grib_accessor_class_check_internal_version.c index a9ed47c26..cdde8f1f2 100644 --- a/src/grib_accessor_class_check_internal_version.c +++ b/src/grib_accessor_class_check_internal_version.c @@ -68,7 +68,9 @@ static grib_accessor_class _grib_accessor_class_check_internal_version = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_closest_date.c b/src/grib_accessor_class_closest_date.c index 417378473..421957f73 100644 --- a/src/grib_accessor_class_closest_date.c +++ b/src/grib_accessor_class_closest_date.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_closest_date = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -130,6 +132,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_codeflag.c b/src/grib_accessor_class_codeflag.c index f3ced0315..0a60fed58 100644 --- a/src/grib_accessor_class_codeflag.c +++ b/src/grib_accessor_class_codeflag.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_codeflag = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_codetable.c b/src/grib_accessor_class_codetable.c index 356758a23..bd71b0b19 100644 --- a/src/grib_accessor_class_codetable.c +++ b/src/grib_accessor_class_codetable.c @@ -121,7 +121,9 @@ static grib_accessor_class _grib_accessor_class_codetable = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -158,7 +160,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_codetable_title.c b/src/grib_accessor_class_codetable_title.c index 648c5db7e..8418d55f5 100644 --- a/src/grib_accessor_class_codetable_title.c +++ b/src/grib_accessor_class_codetable_title.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_codetable_title = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -109,7 +111,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_codetable_units.c b/src/grib_accessor_class_codetable_units.c index 1f40b46ad..9ba3ac9ed 100644 --- a/src/grib_accessor_class_codetable_units.c +++ b/src/grib_accessor_class_codetable_units.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_codetable_units = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -109,7 +111,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index 9fb598f3b..f1d7724c3 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_concept = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,6 +122,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_constant.c b/src/grib_accessor_class_constant.c index dd9fc9c5a..738039527 100644 --- a/src/grib_accessor_class_constant.c +++ b/src/grib_accessor_class_constant.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_constant = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,7 +119,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_count_file.c b/src/grib_accessor_class_count_file.c index 73d7644fd..f0146f77a 100644 --- a/src/grib_accessor_class_count_file.c +++ b/src/grib_accessor_class_count_file.c @@ -70,7 +70,9 @@ static grib_accessor_class _grib_accessor_class_count_file = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,7 +112,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_count_missing.c b/src/grib_accessor_class_count_missing.c index 99b7d0943..da6d1fc2e 100644 --- a/src/grib_accessor_class_count_missing.c +++ b/src/grib_accessor_class_count_missing.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_count_missing = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_count_total.c b/src/grib_accessor_class_count_total.c index 81e3dfd1a..ae6c3309c 100644 --- a/src/grib_accessor_class_count_total.c +++ b/src/grib_accessor_class_count_total.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_count_total = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index 4648390ee..c8a3d6ef1 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -124,7 +124,9 @@ static grib_accessor_class _grib_accessor_class_data_2order_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -163,6 +165,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index c41b74eb6..5c345ffe5 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.c b/src/grib_accessor_class_data_apply_boustrophedonic.c index 5d5486e95..5d0cfbc2c 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -122,6 +124,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c index 84c6163ae..4f9035ef2 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic_bitma 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -127,6 +129,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index 7998dafdc..b2cbe97d2 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_gdsnotpresent = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -131,6 +133,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 370053fed..4abf36b17 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -101,7 +101,9 @@ static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -140,6 +142,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index 4fbc7f101..8bc3b2cf5 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -110,7 +110,9 @@ static grib_accessor_class _grib_accessor_class_data_complex_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -149,6 +151,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_dummy_field.c b/src/grib_accessor_class_data_dummy_field.c index 072d64dae..c90d5df9d 100644 --- a/src/grib_accessor_class_data_dummy_field.c +++ b/src/grib_accessor_class_data_dummy_field.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_data_dummy_field = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -138,6 +140,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1complex_packing.c b/src/grib_accessor_class_data_g1complex_packing.c index 1e7dec871..2e8a0593e 100644 --- a/src/grib_accessor_class_data_g1complex_packing.c +++ b/src/grib_accessor_class_data_g1complex_packing.c @@ -106,7 +106,9 @@ static grib_accessor_class _grib_accessor_class_data_g1complex_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -146,7 +148,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c index c369429a1..452079b15 100644 --- a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c +++ b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c @@ -124,7 +124,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_constant_wid 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -163,6 +165,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c index b39a32ac2..651dd92cc 100644 --- a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c @@ -144,7 +144,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_exte 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -183,6 +185,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1second_order_general_packing.c b/src/grib_accessor_class_data_g1second_order_general_packing.c index 7f8d7892e..d11d92c19 100644 --- a/src/grib_accessor_class_data_g1second_order_general_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_packing.c @@ -121,7 +121,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_pack 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -160,6 +162,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c index 9f4401b32..461049f7e 100644 --- a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c +++ b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c @@ -121,7 +121,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_row_by_row_p 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -160,6 +162,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1secondary_bitmap.c b/src/grib_accessor_class_data_g1secondary_bitmap.c index 697cdfc33..aa888635d 100644 --- a/src/grib_accessor_class_data_g1secondary_bitmap.c +++ b/src/grib_accessor_class_data_g1secondary_bitmap.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_data_g1secondary_bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1shsimple_packing.c b/src/grib_accessor_class_data_g1shsimple_packing.c index c9429dd76..b0924da79 100644 --- a/src/grib_accessor_class_data_g1shsimple_packing.c +++ b/src/grib_accessor_class_data_g1shsimple_packing.c @@ -70,7 +70,9 @@ static grib_accessor_class _grib_accessor_class_data_g1shsimple_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,6 +112,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g1simple_packing.c b/src/grib_accessor_class_data_g1simple_packing.c index 58bae890c..0461d6e2b 100644 --- a/src/grib_accessor_class_data_g1simple_packing.c +++ b/src/grib_accessor_class_data_g1simple_packing.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_data_g1simple_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g22order_packing.c b/src/grib_accessor_class_data_g22order_packing.c index 7220f42a6..21366307b 100644 --- a/src/grib_accessor_class_data_g22order_packing.c +++ b/src/grib_accessor_class_data_g22order_packing.c @@ -119,7 +119,9 @@ static grib_accessor_class _grib_accessor_class_data_g22order_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -158,6 +160,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 09e6005fb..37524b7a0 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -120,7 +120,9 @@ static grib_accessor_class _grib_accessor_class_data_g2bifourier_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -159,6 +161,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g2complex_packing.c b/src/grib_accessor_class_data_g2complex_packing.c index 32cf3c92a..30386fdf6 100644 --- a/src/grib_accessor_class_data_g2complex_packing.c +++ b/src/grib_accessor_class_data_g2complex_packing.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_data_g2complex_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g2secondary_bitmap.c b/src/grib_accessor_class_data_g2secondary_bitmap.c index bb3cdbb12..7e98a0bc2 100644 --- a/src/grib_accessor_class_data_g2secondary_bitmap.c +++ b/src/grib_accessor_class_data_g2secondary_bitmap.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_data_g2secondary_bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g2shsimple_packing.c b/src/grib_accessor_class_data_g2shsimple_packing.c index 1dbbb7b2c..f166060b3 100644 --- a/src/grib_accessor_class_data_g2shsimple_packing.c +++ b/src/grib_accessor_class_data_g2shsimple_packing.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_data_g2shsimple_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,6 +119,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g2simple_packing.c b/src/grib_accessor_class_data_g2simple_packing.c index 5880821e7..5a759ac5a 100644 --- a/src/grib_accessor_class_data_g2simple_packing.c +++ b/src/grib_accessor_class_data_g2simple_packing.c @@ -88,7 +88,9 @@ static grib_accessor_class _grib_accessor_class_data_g2simple_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c index 3a65a7f60..dd391b8a0 100644 --- a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c +++ b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_data_g2simple_packing_with_prepr 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -142,6 +144,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_jpeg2000_packing.c b/src/grib_accessor_class_data_jpeg2000_packing.c index 866a80bfe..008318017 100644 --- a/src/grib_accessor_class_data_jpeg2000_packing.c +++ b/src/grib_accessor_class_data_jpeg2000_packing.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_data_jpeg2000_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -148,6 +150,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index f7c86b13c..95b079853 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_data_png_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -141,6 +143,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_raw_packing.c b/src/grib_accessor_class_data_raw_packing.c index 4439e28e9..6c9470e86 100644 --- a/src/grib_accessor_class_data_raw_packing.c +++ b/src/grib_accessor_class_data_raw_packing.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_data_raw_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -128,6 +130,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_secondary_bitmap.c b/src/grib_accessor_class_data_secondary_bitmap.c index 4a3bbc01e..f9774e60b 100644 --- a/src/grib_accessor_class_data_secondary_bitmap.c +++ b/src/grib_accessor_class_data_secondary_bitmap.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_data_secondary_bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_sh_packed.c b/src/grib_accessor_class_data_sh_packed.c index e7c5da5d6..2dc809432 100644 --- a/src/grib_accessor_class_data_sh_packed.c +++ b/src/grib_accessor_class_data_sh_packed.c @@ -107,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_data_sh_packed = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -147,6 +149,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_sh_unpacked.c b/src/grib_accessor_class_data_sh_unpacked.c index 050534e86..4f36be384 100644 --- a/src/grib_accessor_class_data_sh_unpacked.c +++ b/src/grib_accessor_class_data_sh_unpacked.c @@ -107,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_data_sh_unpacked = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -147,6 +149,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_shsimple_packing.c b/src/grib_accessor_class_data_shsimple_packing.c index 211ac4a32..9337cb4e7 100644 --- a/src/grib_accessor_class_data_shsimple_packing.c +++ b/src/grib_accessor_class_data_shsimple_packing.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_data_shsimple_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 2046616fe..d40b6614a 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -108,7 +108,9 @@ static grib_accessor_class _grib_accessor_class_data_simple_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -147,6 +149,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_decimal_precision.c b/src/grib_accessor_class_decimal_precision.c index 44a23956a..5f2812bd9 100644 --- a/src/grib_accessor_class_decimal_precision.c +++ b/src/grib_accessor_class_decimal_precision.c @@ -79,7 +79,9 @@ static grib_accessor_class _grib_accessor_class_decimal_precision = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_dictionary.c b/src/grib_accessor_class_dictionary.c index 93da5e4de..7eea2f9ec 100644 --- a/src/grib_accessor_class_dictionary.c +++ b/src/grib_accessor_class_dictionary.c @@ -82,7 +82,9 @@ static grib_accessor_class _grib_accessor_class_dictionary = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,6 +121,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_dirty.c b/src/grib_accessor_class_dirty.c index d5b37fcf5..972935bbf 100644 --- a/src/grib_accessor_class_dirty.c +++ b/src/grib_accessor_class_dirty.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_dirty = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_divdouble.c b/src/grib_accessor_class_divdouble.c index 1349259c8..844747fba 100644 --- a/src/grib_accessor_class_divdouble.c +++ b/src/grib_accessor_class_divdouble.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_divdouble = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_double.c b/src/grib_accessor_class_double.c index e9a3430b2..d22698f03 100644 --- a/src/grib_accessor_class_double.c +++ b/src/grib_accessor_class_double.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_double = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_element.c b/src/grib_accessor_class_element.c index 355cdf477..ff44a3d8d 100644 --- a/src/grib_accessor_class_element.c +++ b/src/grib_accessor_class_element.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_element = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_evaluate.c b/src/grib_accessor_class_evaluate.c index 33f5d1e9d..87a38d536 100644 --- a/src/grib_accessor_class_evaluate.c +++ b/src/grib_accessor_class_evaluate.c @@ -70,7 +70,9 @@ static grib_accessor_class _grib_accessor_class_evaluate = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -109,7 +111,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index 7eb3ff68f..e25f1e16a 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -101,7 +101,9 @@ static grib_accessor_class _grib_accessor_class_expanded_descriptors = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -137,6 +139,8 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_forward.c b/src/grib_accessor_class_forward.c index dd07dd037..39ee7caac 100644 --- a/src/grib_accessor_class_forward.c +++ b/src/grib_accessor_class_forward.c @@ -65,7 +65,9 @@ static grib_accessor_class _grib_accessor_class_forward = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -105,7 +107,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_from_scale_factor_scaled_value.c b/src/grib_accessor_class_from_scale_factor_scaled_value.c index daa2e1257..aec51c29e 100644 --- a/src/grib_accessor_class_from_scale_factor_scaled_value.c +++ b/src/grib_accessor_class_from_scale_factor_scaled_value.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_from_scale_factor_scaled_value = 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,6 +120,8 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1_half_byte_codeflag.c b/src/grib_accessor_class_g1_half_byte_codeflag.c index 671524de9..22e606eb9 100644 --- a/src/grib_accessor_class_g1_half_byte_codeflag.c +++ b/src/grib_accessor_class_g1_half_byte_codeflag.c @@ -73,7 +73,9 @@ static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,7 +112,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1_message_length.c b/src/grib_accessor_class_g1_message_length.c index 9608477e3..be0398420 100644 --- a/src/grib_accessor_class_g1_message_length.c +++ b/src/grib_accessor_class_g1_message_length.c @@ -73,7 +73,9 @@ static grib_accessor_class _grib_accessor_class_g1_message_length = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1_section4_length.c b/src/grib_accessor_class_g1_section4_length.c index cbbbaf2fd..b76724a73 100644 --- a/src/grib_accessor_class_g1_section4_length.c +++ b/src/grib_accessor_class_g1_section4_length.c @@ -73,7 +73,9 @@ static grib_accessor_class _grib_accessor_class_g1_section4_length = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1area.c b/src/grib_accessor_class_g1area.c index f329098ce..5af99c7dd 100644 --- a/src/grib_accessor_class_g1area.c +++ b/src/grib_accessor_class_g1area.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_g1area = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,6 +122,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_g1bitmap.c b/src/grib_accessor_class_g1bitmap.c index ff54949f2..862634de7 100644 --- a/src/grib_accessor_class_g1bitmap.c +++ b/src/grib_accessor_class_g1bitmap.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_g1bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1date.c b/src/grib_accessor_class_g1date.c index 8da7889f0..4b2cec614 100644 --- a/src/grib_accessor_class_g1date.c +++ b/src/grib_accessor_class_g1date.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_g1date = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -121,7 +123,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_g1day_of_the_year_date.c b/src/grib_accessor_class_g1day_of_the_year_date.c index ea420ec73..6551c5247 100644 --- a/src/grib_accessor_class_g1day_of_the_year_date.c +++ b/src/grib_accessor_class_g1day_of_the_year_date.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_g1day_of_the_year_date = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_g1end_of_interval_monthly.c b/src/grib_accessor_class_g1end_of_interval_monthly.c index 30cc178d0..a8ed48a10 100644 --- a/src/grib_accessor_class_g1end_of_interval_monthly.c +++ b/src/grib_accessor_class_g1end_of_interval_monthly.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_g1end_of_interval_monthly = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1fcperiod.c b/src/grib_accessor_class_g1fcperiod.c index 85ccc337f..a905ecef7 100644 --- a/src/grib_accessor_class_g1fcperiod.c +++ b/src/grib_accessor_class_g1fcperiod.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_g1fcperiod = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_g1forecastmonth.c b/src/grib_accessor_class_g1forecastmonth.c index 780dd899c..2a94e10d0 100644 --- a/src/grib_accessor_class_g1forecastmonth.c +++ b/src/grib_accessor_class_g1forecastmonth.c @@ -82,7 +82,9 @@ static grib_accessor_class _grib_accessor_class_g1forecastmonth = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,7 +122,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1monthlydate.c b/src/grib_accessor_class_g1monthlydate.c index cbfcf755c..10daccba5 100644 --- a/src/grib_accessor_class_g1monthlydate.c +++ b/src/grib_accessor_class_g1monthlydate.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_g1monthlydate = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c index 1efab6619..bd19466aa 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_comp 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c index ba51e9f42..13d2b39c8 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_simp 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,7 +122,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g1step_range.c b/src/grib_accessor_class_g1step_range.c index b015e6c64..df32776ab 100644 --- a/src/grib_accessor_class_g1step_range.c +++ b/src/grib_accessor_class_g1step_range.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_g1step_range = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_g1verificationdate.c b/src/grib_accessor_class_g1verificationdate.c index f8969233c..5ceea3b9e 100644 --- a/src/grib_accessor_class_g1verificationdate.c +++ b/src/grib_accessor_class_g1verificationdate.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_g1verificationdate = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2_aerosol.c b/src/grib_accessor_class_g2_aerosol.c index 8974efb57..5173de5f0 100644 --- a/src/grib_accessor_class_g2_aerosol.c +++ b/src/grib_accessor_class_g2_aerosol.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_g2_aerosol = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2_chemical.c b/src/grib_accessor_class_g2_chemical.c index d5edd07a9..0501a6007 100644 --- a/src/grib_accessor_class_g2_chemical.c +++ b/src/grib_accessor_class_g2_chemical.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_g2_chemical = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2_eps.c b/src/grib_accessor_class_g2_eps.c index 7dc3a09ab..45742d77e 100644 --- a/src/grib_accessor_class_g2_eps.c +++ b/src/grib_accessor_class_g2_eps.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_g2_eps = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -125,7 +127,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2_mars_labeling.c b/src/grib_accessor_class_g2_mars_labeling.c index 6ba578906..9276b4bfd 100644 --- a/src/grib_accessor_class_g2_mars_labeling.c +++ b/src/grib_accessor_class_g2_mars_labeling.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_g2_mars_labeling = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_g2bitmap.c b/src/grib_accessor_class_g2bitmap.c index a024ea268..7f45c9b32 100644 --- a/src/grib_accessor_class_g2bitmap.c +++ b/src/grib_accessor_class_g2bitmap.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_g2bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2bitmap_present.c b/src/grib_accessor_class_g2bitmap_present.c index d4385763a..90d19cb0c 100644 --- a/src/grib_accessor_class_g2bitmap_present.c +++ b/src/grib_accessor_class_g2bitmap_present.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_g2bitmap_present = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2date.c b/src/grib_accessor_class_g2date.c index 01f7a56c8..a3945bf06 100644 --- a/src/grib_accessor_class_g2date.c +++ b/src/grib_accessor_class_g2date.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_g2date = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2end_step.c b/src/grib_accessor_class_g2end_step.c index 1f69a7a60..735841d30 100644 --- a/src/grib_accessor_class_g2end_step.c +++ b/src/grib_accessor_class_g2end_step.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_g2end_step = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -147,7 +149,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2grid.c b/src/grib_accessor_class_g2grid.c index b4eebb957..614d9295b 100644 --- a/src/grib_accessor_class_g2grid.c +++ b/src/grib_accessor_class_g2grid.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_g2grid = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -129,6 +131,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2latlon.c b/src/grib_accessor_class_g2latlon.c index 0f05a3efb..0a507f23b 100644 --- a/src/grib_accessor_class_g2latlon.c +++ b/src/grib_accessor_class_g2latlon.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_g2latlon = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,6 +121,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2level.c b/src/grib_accessor_class_g2level.c index 4931f2f2b..3171c0696 100644 --- a/src/grib_accessor_class_g2level.c +++ b/src/grib_accessor_class_g2level.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_g2level = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,6 +119,8 @@ static void init_class(grib_accessor_class* c) c->get_native_type = (*(c->super))->get_native_type; c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2lon.c b/src/grib_accessor_class_g2lon.c index 8b45e6935..ad065f751 100644 --- a/src/grib_accessor_class_g2lon.c +++ b/src/grib_accessor_class_g2lon.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_g2lon = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,6 +116,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_g2step_range.c b/src/grib_accessor_class_g2step_range.c index 70f26fc2e..8159ad797 100644 --- a/src/grib_accessor_class_g2step_range.c +++ b/src/grib_accessor_class_g2step_range.c @@ -83,7 +83,9 @@ static grib_accessor_class _grib_accessor_class_g2step_range = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_gaussian_grid_name.c b/src/grib_accessor_class_gaussian_grid_name.c index c7f323999..38d728596 100644 --- a/src/grib_accessor_class_gaussian_grid_name.c +++ b/src/grib_accessor_class_gaussian_grid_name.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_gaussian_grid_name = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_gds_is_present.c b/src/grib_accessor_class_gds_is_present.c index a0229cbc5..c48a9ba52 100644 --- a/src/grib_accessor_class_gds_is_present.c +++ b/src/grib_accessor_class_gds_is_present.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_gds_is_present = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,7 +121,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_gds_not_present_bitmap.c b/src/grib_accessor_class_gds_not_present_bitmap.c index 83409e239..b337730b8 100644 --- a/src/grib_accessor_class_gds_not_present_bitmap.c +++ b/src/grib_accessor_class_gds_not_present_bitmap.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_gds_not_present_bitmap = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index 627dcddd3..fe5a9e199 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -108,7 +108,9 @@ static grib_accessor_class _grib_accessor_class_gen = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ diff --git a/src/grib_accessor_class_getenv.c b/src/grib_accessor_class_getenv.c index a62258b72..2eeb4c010 100644 --- a/src/grib_accessor_class_getenv.c +++ b/src/grib_accessor_class_getenv.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_getenv = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_global_gaussian.c b/src/grib_accessor_class_global_gaussian.c index 37bd565a1..f91fc05ac 100644 --- a/src/grib_accessor_class_global_gaussian.c +++ b/src/grib_accessor_class_global_gaussian.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_global_gaussian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -130,7 +132,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_group.c b/src/grib_accessor_class_group.c index 996ba0a60..769d17722 100644 --- a/src/grib_accessor_class_group.c +++ b/src/grib_accessor_class_group.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_group = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -122,6 +124,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_gts_header.c b/src/grib_accessor_class_gts_header.c index 7c9638935..190fab23c 100644 --- a/src/grib_accessor_class_gts_header.c +++ b/src/grib_accessor_class_gts_header.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_gts_header = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_hash_array.c b/src/grib_accessor_class_hash_array.c index 8e330c7b1..7d194fd81 100644 --- a/src/grib_accessor_class_hash_array.c +++ b/src/grib_accessor_class_hash_array.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_hash_array = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_headers_only.c b/src/grib_accessor_class_headers_only.c index 4bf18ad87..2da5ce7be 100644 --- a/src/grib_accessor_class_headers_only.c +++ b/src/grib_accessor_class_headers_only.c @@ -66,7 +66,9 @@ static grib_accessor_class _grib_accessor_class_headers_only = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -105,7 +107,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_ibmfloat.c b/src/grib_accessor_class_ibmfloat.c index f07ecb48f..cbd5f8671 100644 --- a/src/grib_accessor_class_ibmfloat.c +++ b/src/grib_accessor_class_ibmfloat.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_ibmfloat = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -123,6 +125,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_ieeefloat.c b/src/grib_accessor_class_ieeefloat.c index 8e8b023e5..89634f0f5 100644 --- a/src/grib_accessor_class_ieeefloat.c +++ b/src/grib_accessor_class_ieeefloat.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_ieeefloat = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,6 +117,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_ifs_param.c b/src/grib_accessor_class_ifs_param.c index df9d29e17..0758b3632 100644 --- a/src/grib_accessor_class_ifs_param.c +++ b/src/grib_accessor_class_ifs_param.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_ifs_param = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int16.c b/src/grib_accessor_class_int16.c index a4e5bdc3d..67360bebc 100644 --- a/src/grib_accessor_class_int16.c +++ b/src/grib_accessor_class_int16.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int16 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int16_little_endian.c b/src/grib_accessor_class_int16_little_endian.c index a735589fe..3a2ad30c8 100644 --- a/src/grib_accessor_class_int16_little_endian.c +++ b/src/grib_accessor_class_int16_little_endian.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int16_little_endian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int32.c b/src/grib_accessor_class_int32.c index c8b9d4bac..47de07a65 100644 --- a/src/grib_accessor_class_int32.c +++ b/src/grib_accessor_class_int32.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int32 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int32_little_endian.c b/src/grib_accessor_class_int32_little_endian.c index 09b96d0f7..8af8708e4 100644 --- a/src/grib_accessor_class_int32_little_endian.c +++ b/src/grib_accessor_class_int32_little_endian.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int32_little_endian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int64.c b/src/grib_accessor_class_int64.c index e4c226a55..4f930ed91 100644 --- a/src/grib_accessor_class_int64.c +++ b/src/grib_accessor_class_int64.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int64 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int64_little_endian.c b/src/grib_accessor_class_int64_little_endian.c index 56a650c26..bf344500d 100644 --- a/src/grib_accessor_class_int64_little_endian.c +++ b/src/grib_accessor_class_int64_little_endian.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int64_little_endian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_int8.c b/src/grib_accessor_class_int8.c index 409e58218..fae78881b 100644 --- a/src/grib_accessor_class_int8.c +++ b/src/grib_accessor_class_int8.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_int8 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_iterator.c b/src/grib_accessor_class_iterator.c index 8ba156099..559a1585f 100644 --- a/src/grib_accessor_class_iterator.c +++ b/src/grib_accessor_class_iterator.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_iterator = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -111,7 +113,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_julian_date.c b/src/grib_accessor_class_julian_date.c index 54f0b436f..cfa9825bc 100644 --- a/src/grib_accessor_class_julian_date.c +++ b/src/grib_accessor_class_julian_date.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_julian_date = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -134,6 +136,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_julian_day.c b/src/grib_accessor_class_julian_day.c index 7c746d1d5..6014d996f 100644 --- a/src/grib_accessor_class_julian_day.c +++ b/src/grib_accessor_class_julian_day.c @@ -82,7 +82,9 @@ static grib_accessor_class _grib_accessor_class_julian_day = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,6 +121,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_ksec1expver.c b/src/grib_accessor_class_ksec1expver.c index 06d54f836..9aefb91a9 100644 --- a/src/grib_accessor_class_ksec1expver.c +++ b/src/grib_accessor_class_ksec1expver.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_ksec1expver = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,7 +112,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_label.c b/src/grib_accessor_class_label.c index 4451c6ce1..d71d7b727 100644 --- a/src/grib_accessor_class_label.c +++ b/src/grib_accessor_class_label.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_label = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -108,7 +110,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_laplacian.c b/src/grib_accessor_class_laplacian.c index 6258e3b35..68114d14b 100644 --- a/src/grib_accessor_class_laplacian.c +++ b/src/grib_accessor_class_laplacian.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_laplacian = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_latitudes.c b/src/grib_accessor_class_latitudes.c index 38f55767b..b2fb2ec5c 100644 --- a/src/grib_accessor_class_latitudes.c +++ b/src/grib_accessor_class_latitudes.c @@ -79,7 +79,9 @@ static grib_accessor_class _grib_accessor_class_latitudes = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,6 +121,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_latlon_increment.c b/src/grib_accessor_class_latlon_increment.c index 5fe4f3e0e..a8fdb0010 100644 --- a/src/grib_accessor_class_latlon_increment.c +++ b/src/grib_accessor_class_latlon_increment.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_latlon_increment = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -126,6 +128,8 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_latlonvalues.c b/src/grib_accessor_class_latlonvalues.c index 021bddba9..01aed3bcd 100644 --- a/src/grib_accessor_class_latlonvalues.c +++ b/src/grib_accessor_class_latlonvalues.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_latlonvalues = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_library_version.c b/src/grib_accessor_class_library_version.c index 8872c8a1c..7627f69d9 100644 --- a/src/grib_accessor_class_library_version.c +++ b/src/grib_accessor_class_library_version.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_library_version = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 5240eb129..926c59914 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_local_definition = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_long.c b/src/grib_accessor_class_long.c index c3f562be3..3433dbb24 100644 --- a/src/grib_accessor_class_long.c +++ b/src/grib_accessor_class_long.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_long = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,6 +114,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_long_vector.c b/src/grib_accessor_class_long_vector.c index e53adb057..51fdd818b 100644 --- a/src/grib_accessor_class_long_vector.c +++ b/src/grib_accessor_class_long_vector.c @@ -83,7 +83,9 @@ static grib_accessor_class _grib_accessor_class_long_vector = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -121,6 +123,8 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_longitudes.c b/src/grib_accessor_class_longitudes.c index a555d8d20..e8d423fbb 100644 --- a/src/grib_accessor_class_longitudes.c +++ b/src/grib_accessor_class_longitudes.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_longitudes = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_lookup.c b/src/grib_accessor_class_lookup.c index 8389872cb..3ae87a317 100644 --- a/src/grib_accessor_class_lookup.c +++ b/src/grib_accessor_class_lookup.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_lookup = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,7 +122,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_mars_param.c b/src/grib_accessor_class_mars_param.c index ba26e4600..82223561e 100644 --- a/src/grib_accessor_class_mars_param.c +++ b/src/grib_accessor_class_mars_param.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_mars_param = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_mars_step.c b/src/grib_accessor_class_mars_step.c index 7c351591f..515deef1c 100644 --- a/src/grib_accessor_class_mars_step.c +++ b/src/grib_accessor_class_mars_step.c @@ -79,7 +79,9 @@ static grib_accessor_class _grib_accessor_class_mars_step = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_md5.c b/src/grib_accessor_class_md5.c index 14f2f9bc5..9ce199ff8 100644 --- a/src/grib_accessor_class_md5.c +++ b/src/grib_accessor_class_md5.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_md5 = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_message.c b/src/grib_accessor_class_message.c index 055d735b8..c4c35dd41 100644 --- a/src/grib_accessor_class_message.c +++ b/src/grib_accessor_class_message.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_message = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_message_copy.c b/src/grib_accessor_class_message_copy.c index c80ff9970..8b55e3d71 100644 --- a/src/grib_accessor_class_message_copy.c +++ b/src/grib_accessor_class_message_copy.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_message_copy = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -109,7 +111,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_missing.c b/src/grib_accessor_class_missing.c index d9f1d9214..c88b7b54e 100644 --- a/src/grib_accessor_class_missing.c +++ b/src/grib_accessor_class_missing.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_missing = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ diff --git a/src/grib_accessor_class_nearest.c b/src/grib_accessor_class_nearest.c index 811a4ac28..9c43b081e 100644 --- a/src/grib_accessor_class_nearest.c +++ b/src/grib_accessor_class_nearest.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_nearest = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_non_alpha.c b/src/grib_accessor_class_non_alpha.c index 11004a611..c82c49fb9 100644 --- a/src/grib_accessor_class_non_alpha.c +++ b/src/grib_accessor_class_non_alpha.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_non_alpha = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,6 +121,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_number_of_coded_values.c b/src/grib_accessor_class_number_of_coded_values.c index eb45eb745..667705ba5 100644 --- a/src/grib_accessor_class_number_of_coded_values.c +++ b/src/grib_accessor_class_number_of_coded_values.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_number_of_coded_values = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,7 +122,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_number_of_points.c b/src/grib_accessor_class_number_of_points.c index 45568de1c..fda0c6358 100644 --- a/src/grib_accessor_class_number_of_points.c +++ b/src/grib_accessor_class_number_of_points.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_number_of_points = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_number_of_points_gaussian.c b/src/grib_accessor_class_number_of_points_gaussian.c index e343eeb3a..db9a75b24 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.c +++ b/src/grib_accessor_class_number_of_points_gaussian.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_number_of_points_gaussian = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_number_of_values.c b/src/grib_accessor_class_number_of_values.c index 7c38437c0..8f96090ef 100644 --- a/src/grib_accessor_class_number_of_values.c +++ b/src/grib_accessor_class_number_of_values.c @@ -82,7 +82,9 @@ static grib_accessor_class _grib_accessor_class_number_of_values = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -122,7 +124,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_number_of_values_data_raw_packing.c b/src/grib_accessor_class_number_of_values_data_raw_packing.c index 42ad656df..8a61a6016 100644 --- a/src/grib_accessor_class_number_of_values_data_raw_packing.c +++ b/src/grib_accessor_class_number_of_values_data_raw_packing.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_number_of_values_data_raw_packin 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -123,7 +125,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_octahedral_gaussian.c b/src/grib_accessor_class_octahedral_gaussian.c index d6db8565d..1d7bd0c37 100644 --- a/src/grib_accessor_class_octahedral_gaussian.c +++ b/src/grib_accessor_class_octahedral_gaussian.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_octahedral_gaussian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,7 +119,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_octet_number.c b/src/grib_accessor_class_octet_number.c index bd4b3f4e5..3774c2291 100644 --- a/src/grib_accessor_class_octet_number.c +++ b/src/grib_accessor_class_octet_number.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_octet_number = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_offset_file.c b/src/grib_accessor_class_offset_file.c index 44c9af50b..d3cfe77b4 100644 --- a/src/grib_accessor_class_offset_file.c +++ b/src/grib_accessor_class_offset_file.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_offset_file = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,6 +115,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_offset_values.c b/src/grib_accessor_class_offset_values.c index 95fde2dbb..3df6461e4 100644 --- a/src/grib_accessor_class_offset_values.c +++ b/src/grib_accessor_class_offset_values.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_offset_values = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,6 +117,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_pack_bufr_values.c b/src/grib_accessor_class_pack_bufr_values.c index 690d7f0ed..89898494e 100644 --- a/src/grib_accessor_class_pack_bufr_values.c +++ b/src/grib_accessor_class_pack_bufr_values.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_pack_bufr_values = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_pad.c b/src/grib_accessor_class_pad.c index 460055c19..fc52a536c 100644 --- a/src/grib_accessor_class_pad.c +++ b/src/grib_accessor_class_pad.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_pad = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_padding.c b/src/grib_accessor_class_padding.c index cfb47097e..a7588c6ba 100644 --- a/src/grib_accessor_class_padding.c +++ b/src/grib_accessor_class_padding.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_padding = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_padto.c b/src/grib_accessor_class_padto.c index cc69fd1a2..5df9d3fa1 100644 --- a/src/grib_accessor_class_padto.c +++ b/src/grib_accessor_class_padto.c @@ -74,7 +74,9 @@ static grib_accessor_class _grib_accessor_class_padto = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_padtoeven.c b/src/grib_accessor_class_padtoeven.c index b0e88a8d5..c3aa1a2e9 100644 --- a/src/grib_accessor_class_padtoeven.c +++ b/src/grib_accessor_class_padtoeven.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_padtoeven = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,7 +119,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_padtomultiple.c b/src/grib_accessor_class_padtomultiple.c index d8afbeba3..0cf3a4c43 100644 --- a/src/grib_accessor_class_padtomultiple.c +++ b/src/grib_accessor_class_padtomultiple.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_padtomultiple = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,7 +119,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_position.c b/src/grib_accessor_class_position.c index b0769ca0b..de4ec7790 100644 --- a/src/grib_accessor_class_position.c +++ b/src/grib_accessor_class_position.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_position = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -114,7 +116,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_proj_string.c b/src/grib_accessor_class_proj_string.c index 37317eebc..abe5b1737 100644 --- a/src/grib_accessor_class_proj_string.c +++ b/src/grib_accessor_class_proj_string.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_proj_string = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -111,7 +113,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_raw.c b/src/grib_accessor_class_raw.c index ae685ed3b..04614f595 100644 --- a/src/grib_accessor_class_raw.c +++ b/src/grib_accessor_class_raw.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_raw = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_rdbtime_guess_date.c b/src/grib_accessor_class_rdbtime_guess_date.c index 7c46c7c6b..a1678476b 100644 --- a/src/grib_accessor_class_rdbtime_guess_date.c +++ b/src/grib_accessor_class_rdbtime_guess_date.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_rdbtime_guess_date = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_reference_value_error.c b/src/grib_accessor_class_reference_value_error.c index 1f8812b2a..0f7b137b6 100644 --- a/src/grib_accessor_class_reference_value_error.c +++ b/src/grib_accessor_class_reference_value_error.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_reference_value_error = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,6 +119,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_round.c b/src/grib_accessor_class_round.c index bfc59442a..de83abb31 100644 --- a/src/grib_accessor_class_round.c +++ b/src/grib_accessor_class_round.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_round = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,6 +112,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_scale.c b/src/grib_accessor_class_scale.c index fc474c0d8..a545c6f15 100644 --- a/src/grib_accessor_class_scale.c +++ b/src/grib_accessor_class_scale.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_scale = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -122,6 +124,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_scale_values.c b/src/grib_accessor_class_scale_values.c index c0e7f0ff5..30ab46b89 100644 --- a/src/grib_accessor_class_scale_values.c +++ b/src/grib_accessor_class_scale_values.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_scale_values = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,6 +117,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_second_order_bits_per_value.c b/src/grib_accessor_class_second_order_bits_per_value.c index eb0a5811d..182d9e113 100644 --- a/src/grib_accessor_class_second_order_bits_per_value.c +++ b/src/grib_accessor_class_second_order_bits_per_value.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_second_order_bits_per_value = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,7 +121,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_section.c b/src/grib_accessor_class_section.c index 9964c682b..f15a944ff 100644 --- a/src/grib_accessor_class_section.c +++ b/src/grib_accessor_class_section.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_section = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_section_length.c b/src/grib_accessor_class_section_length.c index 95f3dc550..c2a29271e 100644 --- a/src/grib_accessor_class_section_length.c +++ b/src/grib_accessor_class_section_length.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_section_length = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,7 +112,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_section_padding.c b/src/grib_accessor_class_section_padding.c index 5de803d00..b03dcfbe9 100644 --- a/src/grib_accessor_class_section_padding.c +++ b/src/grib_accessor_class_section_padding.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_section_padding = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -110,7 +112,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_section_pointer.c b/src/grib_accessor_class_section_pointer.c index 7a6369263..62229e039 100644 --- a/src/grib_accessor_class_section_pointer.c +++ b/src/grib_accessor_class_section_pointer.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_section_pointer = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_select_step_template.c b/src/grib_accessor_class_select_step_template.c index fed9fee4a..aee085388 100644 --- a/src/grib_accessor_class_select_step_template.c +++ b/src/grib_accessor_class_select_step_template.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_select_step_template = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -119,7 +121,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_sexagesimal2decimal.c b/src/grib_accessor_class_sexagesimal2decimal.c index 5279bdefd..b78b955f5 100644 --- a/src/grib_accessor_class_sexagesimal2decimal.c +++ b/src/grib_accessor_class_sexagesimal2decimal.c @@ -77,7 +77,9 @@ static grib_accessor_class _grib_accessor_class_sexagesimal2decimal = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_signed.c b/src/grib_accessor_class_signed.c index 08d899a4d..2767c0236 100644 --- a/src/grib_accessor_class_signed.c +++ b/src/grib_accessor_class_signed.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_signed = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_signed_bits.c b/src/grib_accessor_class_signed_bits.c index e9510bade..7fc1abd16 100644 --- a/src/grib_accessor_class_signed_bits.c +++ b/src/grib_accessor_class_signed_bits.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_signed_bits = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_simple_packing_error.c b/src/grib_accessor_class_simple_packing_error.c index f0d8a0435..c64a82409 100644 --- a/src/grib_accessor_class_simple_packing_error.c +++ b/src/grib_accessor_class_simple_packing_error.c @@ -82,7 +82,9 @@ static grib_accessor_class _grib_accessor_class_simple_packing_error = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -123,6 +125,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_size.c b/src/grib_accessor_class_size.c index 67308d594..ff024190a 100644 --- a/src/grib_accessor_class_size.c +++ b/src/grib_accessor_class_size.c @@ -68,7 +68,9 @@ static grib_accessor_class _grib_accessor_class_size = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -108,7 +110,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_smart_table.c b/src/grib_accessor_class_smart_table.c index d2d21e04e..687a5bfd6 100644 --- a/src/grib_accessor_class_smart_table.c +++ b/src/grib_accessor_class_smart_table.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_smart_table = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_smart_table_column.c b/src/grib_accessor_class_smart_table_column.c index 249038448..083c3b5bf 100644 --- a/src/grib_accessor_class_smart_table_column.c +++ b/src/grib_accessor_class_smart_table_column.c @@ -76,7 +76,9 @@ static grib_accessor_class _grib_accessor_class_smart_table_column = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -113,7 +115,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index cebc15c77..9d6aa3bd3 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_spd = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_spectral_truncation.c b/src/grib_accessor_class_spectral_truncation.c index 5e901a4ba..f5cb89cd6 100644 --- a/src/grib_accessor_class_spectral_truncation.c +++ b/src/grib_accessor_class_spectral_truncation.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_spectral_truncation = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,7 +122,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_sprintf.c b/src/grib_accessor_class_sprintf.c index d2794d7c3..317a05402 100644 --- a/src/grib_accessor_class_sprintf.c +++ b/src/grib_accessor_class_sprintf.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_sprintf = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -111,7 +113,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_statistics.c b/src/grib_accessor_class_statistics.c index 6a509c9f4..1ab3debfd 100644 --- a/src/grib_accessor_class_statistics.c +++ b/src/grib_accessor_class_statistics.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_statistics = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -125,6 +127,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_statistics_spectral.c b/src/grib_accessor_class_statistics_spectral.c index 270f14504..b2b200a48 100644 --- a/src/grib_accessor_class_statistics_spectral.c +++ b/src/grib_accessor_class_statistics_spectral.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_statistics_spectral = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -129,6 +131,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_step_human_readable.c b/src/grib_accessor_class_step_human_readable.c index d536941de..dea4b8ce6 100644 --- a/src/grib_accessor_class_step_human_readable.c +++ b/src/grib_accessor_class_step_human_readable.c @@ -71,7 +71,9 @@ static grib_accessor_class _grib_accessor_class_step_human_readable = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -111,7 +113,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_step_in_units.c b/src/grib_accessor_class_step_in_units.c index e8fac61ed..fec21ead6 100644 --- a/src/grib_accessor_class_step_in_units.c +++ b/src/grib_accessor_class_step_in_units.c @@ -80,7 +80,9 @@ static grib_accessor_class _grib_accessor_class_step_in_units = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_sum.c b/src/grib_accessor_class_sum.c index fa793b611..eb195e513 100644 --- a/src/grib_accessor_class_sum.c +++ b/src/grib_accessor_class_sum.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_sum = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,6 +119,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_suppressed.c b/src/grib_accessor_class_suppressed.c index 61f4cde32..9538e95e3 100644 --- a/src/grib_accessor_class_suppressed.c +++ b/src/grib_accessor_class_suppressed.c @@ -79,7 +79,9 @@ static grib_accessor_class _grib_accessor_class_suppressed = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,6 +117,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_time.c b/src/grib_accessor_class_time.c index f52d23083..52f155962 100644 --- a/src/grib_accessor_class_time.c +++ b/src/grib_accessor_class_time.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_time = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; diff --git a/src/grib_accessor_class_times.c b/src/grib_accessor_class_times.c index 4d431f3b0..cc6809eb4 100644 --- a/src/grib_accessor_class_times.c +++ b/src/grib_accessor_class_times.c @@ -78,7 +78,9 @@ static grib_accessor_class _grib_accessor_class_times = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,7 +118,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index 5f2df9b00..d9a6b5dec 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_to_double = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -128,6 +130,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_to_integer.c b/src/grib_accessor_class_to_integer.c index 0c847a9e8..55d7ae985 100644 --- a/src/grib_accessor_class_to_integer.c +++ b/src/grib_accessor_class_to_integer.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_to_integer = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -126,6 +128,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_to_string.c b/src/grib_accessor_class_to_string.c index a6a5032d9..3de83fa06 100644 --- a/src/grib_accessor_class_to_string.c +++ b/src/grib_accessor_class_to_string.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_to_string = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -126,6 +128,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_transient.c b/src/grib_accessor_class_transient.c index 3c4199842..bf2a76201 100644 --- a/src/grib_accessor_class_transient.c +++ b/src/grib_accessor_class_transient.c @@ -68,7 +68,9 @@ static grib_accessor_class _grib_accessor_class_transient = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -109,7 +111,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_transient_darray.c b/src/grib_accessor_class_transient_darray.c index 9750db127..bfa18589e 100644 --- a/src/grib_accessor_class_transient_darray.c +++ b/src/grib_accessor_class_transient_darray.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_transient_darray = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_trim.c b/src/grib_accessor_class_trim.c index a974d1077..21da77b53 100644 --- a/src/grib_accessor_class_trim.c +++ b/src/grib_accessor_class_trim.c @@ -75,7 +75,9 @@ static grib_accessor_class _grib_accessor_class_trim = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -115,7 +117,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_uint16.c b/src/grib_accessor_class_uint16.c index d66401a05..905e160b2 100644 --- a/src/grib_accessor_class_uint16.c +++ b/src/grib_accessor_class_uint16.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_uint16 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_uint16_little_endian.c b/src/grib_accessor_class_uint16_little_endian.c index 16407bed8..3ad93b61d 100644 --- a/src/grib_accessor_class_uint16_little_endian.c +++ b/src/grib_accessor_class_uint16_little_endian.c @@ -67,7 +67,9 @@ static grib_accessor_class _grib_accessor_class_uint16_little_endian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -106,7 +108,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_uint32.c b/src/grib_accessor_class_uint32.c index 7f384d57f..f68387d97 100644 --- a/src/grib_accessor_class_uint32.c +++ b/src/grib_accessor_class_uint32.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_uint32 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_uint32_little_endian.c b/src/grib_accessor_class_uint32_little_endian.c index 575c90978..14daad975 100644 --- a/src/grib_accessor_class_uint32_little_endian.c +++ b/src/grib_accessor_class_uint32_little_endian.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_uint32_little_endian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_uint64.c b/src/grib_accessor_class_uint64.c index 18717068b..bda6395fd 100644 --- a/src/grib_accessor_class_uint64.c +++ b/src/grib_accessor_class_uint64.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_uint64 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_uint64_little_endian.c b/src/grib_accessor_class_uint64_little_endian.c index bd4e87be8..d5b3f8342 100644 --- a/src/grib_accessor_class_uint64_little_endian.c +++ b/src/grib_accessor_class_uint64_little_endian.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_uint64_little_endian = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_uint8.c b/src/grib_accessor_class_uint8.c index 52daeb545..9207aec16 100644 --- a/src/grib_accessor_class_uint8.c +++ b/src/grib_accessor_class_uint8.c @@ -69,7 +69,9 @@ static grib_accessor_class _grib_accessor_class_uint8 = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -107,7 +109,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_unexpanded_descriptors.c b/src/grib_accessor_class_unexpanded_descriptors.c index fd7f43ab1..a3dce70ad 100644 --- a/src/grib_accessor_class_unexpanded_descriptors.c +++ b/src/grib_accessor_class_unexpanded_descriptors.c @@ -82,7 +82,9 @@ static grib_accessor_class _grib_accessor_class_unexpanded_descriptors = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -117,7 +119,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_unpack_bufr_values.c b/src/grib_accessor_class_unpack_bufr_values.c index eb6afff57..28122705d 100644 --- a/src/grib_accessor_class_unpack_bufr_values.c +++ b/src/grib_accessor_class_unpack_bufr_values.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_unpack_bufr_values = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -116,6 +118,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_unsigned.c b/src/grib_accessor_class_unsigned.c index 5fe6195b6..1738886dd 100644 --- a/src/grib_accessor_class_unsigned.c +++ b/src/grib_accessor_class_unsigned.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_unsigned = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_unsigned_bits.c b/src/grib_accessor_class_unsigned_bits.c index 23a16cc09..39d659880 100644 --- a/src/grib_accessor_class_unsigned_bits.c +++ b/src/grib_accessor_class_unsigned_bits.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_unsigned_bits = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -118,7 +120,9 @@ static void init_class(grib_accessor_class* c) c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_validity_date.c b/src/grib_accessor_class_validity_date.c index 428093375..9e514d92a 100644 --- a/src/grib_accessor_class_validity_date.c +++ b/src/grib_accessor_class_validity_date.c @@ -83,7 +83,9 @@ static grib_accessor_class _grib_accessor_class_validity_date = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -122,7 +124,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_validity_time.c b/src/grib_accessor_class_validity_time.c index 81fe79a6e..aa2a5d3ee 100644 --- a/src/grib_accessor_class_validity_time.c +++ b/src/grib_accessor_class_validity_time.c @@ -81,7 +81,9 @@ static grib_accessor_class _grib_accessor_class_validity_time = { 0, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,7 +122,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_values.c b/src/grib_accessor_class_values.c index 733ea0f34..cca5d9459 100644 --- a/src/grib_accessor_class_values.c +++ b/src/grib_accessor_class_values.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_values = { &pack_long, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_variable.c b/src/grib_accessor_class_variable.c index 1183c5f4c..7b0e91525 100644 --- a/src/grib_accessor_class_variable.c +++ b/src/grib_accessor_class_variable.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_variable = { &pack_long, /* grib_pack procedures long */ &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -124,6 +126,8 @@ static void init_class(grib_accessor_class* c) c->sub_section = (*(c->super))->sub_section; c->pack_missing = (*(c->super))->pack_missing; c->is_missing = (*(c->super))->is_missing; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; c->pack_bytes = (*(c->super))->pack_bytes; diff --git a/src/grib_accessor_class_vector.c b/src/grib_accessor_class_vector.c index 627ab6a83..fda5c6017 100644 --- a/src/grib_accessor_class_vector.c +++ b/src/grib_accessor_class_vector.c @@ -79,7 +79,9 @@ static grib_accessor_class _grib_accessor_class_vector = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -120,6 +122,8 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_when.c b/src/grib_accessor_class_when.c index 8adaae235..f2454c4f1 100644 --- a/src/grib_accessor_class_when.c +++ b/src/grib_accessor_class_when.c @@ -72,7 +72,9 @@ static grib_accessor_class _grib_accessor_class_when = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ 0, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -112,7 +114,9 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_double = (*(c->super))->pack_double; + c->pack_float = (*(c->super))->pack_float; c->unpack_double = (*(c->super))->unpack_double; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 20751f4f9..63533afb9 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -313,6 +313,7 @@ typedef void (*accessor_destroy_proc)(grib_context*, grib_accessor*); typedef int (*accessor_unpack_long_proc)(grib_accessor*, long*, size_t* len); typedef int (*accessor_unpack_double_proc)(grib_accessor*, double*, size_t* len); +typedef int (*accessor_unpack_float_proc)(grib_accessor*, float*, size_t* len); typedef int (*accessor_unpack_double_element_proc)(grib_accessor*, size_t, double*); typedef int (*accessor_unpack_double_element_set_proc)(grib_accessor*, const size_t*, size_t, double*); @@ -335,6 +336,7 @@ typedef int (*accessor_pack_missing_proc)(grib_accessor*); typedef int (*accessor_pack_is_missing_proc)(grib_accessor*); typedef int (*accessor_pack_long_proc)(grib_accessor*, const long*, size_t* len); typedef int (*accessor_pack_double_proc)(grib_accessor*, const double*, size_t* len); +typedef int (*accessor_pack_float_proc)(grib_accessor*, const float*, size_t* len); typedef int (*accessor_pack_string_proc)(grib_accessor*, const char*, size_t* len); typedef int (*accessor_pack_string_array_proc)(grib_accessor*, const char**, size_t* len); typedef int (*accessor_pack_bytes_proc)(grib_accessor*, const unsigned char*, size_t* len); @@ -957,7 +959,9 @@ struct grib_accessor_class accessor_unpack_long_proc unpack_long; accessor_pack_double_proc pack_double; + accessor_pack_float_proc pack_float; accessor_unpack_double_proc unpack_double; + accessor_unpack_float_proc unpack_float; accessor_pack_string_proc pack_string; accessor_unpack_string_proc unpack_string; diff --git a/src/grib_iterator_class_gaussian.c b/src/grib_iterator_class_gaussian.c index 9b1fb9722..25867e13b 100644 --- a/src/grib_iterator_class_gaussian.c +++ b/src/grib_iterator_class_gaussian.c @@ -36,8 +36,10 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); -static int init (grib_iterator* i,grib_handle*,grib_arguments*); +static void init_class (grib_iterator_class*); + +static int init (grib_iterator* i,grib_handle*,grib_arguments*); + typedef struct grib_iterator_gaussian{ grib_iterator it; @@ -80,10 +82,10 @@ grib_iterator_class* grib_iterator_class_gaussian = &_grib_iterator_class_gaussi static void init_class(grib_iterator_class* c) { - c->next = (*(c->super))->next; - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->next = (*(c->super))->next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ diff --git a/src/grib_iterator_class_latlon.c b/src/grib_iterator_class_latlon.c index a3ea502b5..acf63da87 100644 --- a/src/grib_iterator_class_latlon.c +++ b/src/grib_iterator_class_latlon.c @@ -32,9 +32,11 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); +static void init_class (grib_iterator_class*); + +static int init (grib_iterator* i,grib_handle*,grib_arguments*); +static int next (grib_iterator* i, double *lat, double *lon, double *val); + typedef struct grib_iterator_latlon{ grib_iterator it; @@ -77,9 +79,9 @@ grib_iterator_class* grib_iterator_class_latlon = &_grib_iterator_class_latlon; static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ From 78af61b989fabfbd2b16a055407c80564a982404 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Dec 2022 14:55:43 +0000 Subject: [PATCH 003/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 02) --- src/eccodes.c | 4 +++ src/eccodes.h | 1 + src/eccodes_prototypes.h | 8 ++++++ src/grib_accessor.c | 52 +++++++++++++++++++++++++++++++++++ src/grib_accessor_class_gen.c | 27 +++++++++++++++++- src/grib_api.h | 1 + src/grib_value.c | 42 ++++++++++++++++++++++++++++ 7 files changed, 134 insertions(+), 1 deletion(-) diff --git a/src/eccodes.c b/src/eccodes.c index feffc5b04..ec5e538e3 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -361,6 +361,10 @@ int codes_get_double_array(const grib_handle* h, const char* key, double* vals, { return grib_get_double_array(h, key, vals, length); } +int codes_get_float_array(const grib_handle* h, const char* key, float* vals, size_t* length) +{ + return grib_get_float_array(h, key, vals, length); +} int codes_get_long_array(const grib_handle* h, const char* key, long* vals, size_t* length) { return grib_get_long_array(h, key, vals, length); diff --git a/src/eccodes.h b/src/eccodes.h index 68f97b58b..dfe7d53be 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -844,6 +844,7 @@ int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes * @return 0 if OK, integer value on error */ int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t* length); +int codes_get_float_array(const codes_handle* h, const char* key, float* vals, size_t* length); /** * Get long array values from a key. If several keys of the same name are present, the last one is returned diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index d35454489..6cb2d8307 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -115,6 +115,7 @@ int grib_pack_missing(grib_accessor* a); int grib_pack_zero(grib_accessor* a); int grib_is_missing_internal(grib_accessor* a); int grib_pack_double(grib_accessor* a, const double* v, size_t* len); +int grib_pack_float(grib_accessor* a, const float* v, size_t* len); int grib_pack_expression(grib_accessor* a, grib_expression* e); int grib_pack_string(grib_accessor* a, const char* v, size_t* len); int grib_pack_string_array(grib_accessor* a, const char** v, size_t* len); @@ -123,8 +124,11 @@ int grib_pack_bytes(grib_accessor* a, const unsigned char* v, size_t* len); int grib_unpack_bytes(grib_accessor* a, unsigned char* v, size_t* len); int grib_unpack_double_subarray(grib_accessor* a, double* v, size_t start, size_t len); int grib_unpack_double(grib_accessor* a, double* v, size_t* len); +int grib_unpack_float(grib_accessor* a, float* v, size_t* len); int grib_unpack_double_element(grib_accessor* a, size_t i, double* v); int grib_unpack_double_element_set(grib_accessor* a, const size_t* index_array, size_t len, double* val_array); +int grib_unpack_float_element(grib_accessor* a, size_t i, float* v); +int grib_unpack_float_element_set(grib_accessor* a, const size_t* index_array, size_t len, float* val_array); int grib_unpack_string(grib_accessor* a, char* v, size_t* len); int grib_unpack_string_array(grib_accessor* a, char** v, size_t* len); int grib_accessors_list_unpack_long(grib_accessors_list* al, long* val, size_t* buffer_len); @@ -1250,8 +1254,12 @@ int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, s int grib_get_native_type(const grib_handle* h, const char* name, int* type); const char* grib_get_accessor_class_name(grib_handle* h, const char* name); int ecc__grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length); + int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length); int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length); +int grib_get_float_array_internal(const grib_handle* h, const char* name, float* val, size_t* length); +int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t* length); + int ecc__grib_get_string_length(grib_accessor* a, size_t* size); int grib_get_string_length(const grib_handle* h, const char* name, size_t* size); int ecc__grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size); diff --git a/src/grib_accessor.c b/src/grib_accessor.c index 148005780..51b603626 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -98,6 +98,19 @@ int grib_pack_double(grib_accessor* a, const double* v, size_t* len) return 0; } +int grib_pack_float(grib_accessor* a, const float* v, size_t* len) +{ + grib_accessor_class* c = a->cclass; + while (c) { + if (c->pack_float) { + return c->pack_float(a, v, len); + } + c = c->super ? *(c->super) : NULL; + } + DebugAssert(0); + return 0; +} + int grib_pack_expression(grib_accessor* a, grib_expression* e) { grib_accessor_class* c = a->cclass; @@ -209,6 +222,19 @@ int grib_unpack_double(grib_accessor* a, double* v, size_t* len) return 0; } +int grib_unpack_float(grib_accessor* a, float* v, size_t* len) +{ + grib_accessor_class* c = a->cclass; + while (c) { + if (c->unpack_float) { + return c->unpack_float(a, v, len); + } + c = c->super ? *(c->super) : NULL; + } + DebugAssert(0); + return GRIB_NOT_IMPLEMENTED; +} + int grib_unpack_double_element(grib_accessor* a, size_t i, double* v) { grib_accessor_class* c = a->cclass; @@ -220,6 +246,18 @@ int grib_unpack_double_element(grib_accessor* a, size_t i, double* v) } return GRIB_NOT_IMPLEMENTED; } +int grib_unpack_float_element(grib_accessor* a, size_t i, float* v) +{ + /* grib_accessor_class* c = a->cclass; + * while (c) { + * if (c->unpack_float_element) { + * return c->unpack_float_element(a, i, v); + * } + * c = c->super ? *(c->super) : NULL; + * } + */ + return GRIB_NOT_IMPLEMENTED; +} /* Get the values for the indices passed in. * The length of the 'index_array' argument should be 'len' and 'val_array' should also contain at least 'len' elements @@ -236,6 +274,20 @@ int grib_unpack_double_element_set(grib_accessor* a, const size_t* index_array, } return GRIB_NOT_IMPLEMENTED; } +int grib_unpack_float_element_set(grib_accessor* a, const size_t* index_array, size_t len, float* val_array) +{ + /* + *grib_accessor_class* c = a->cclass; + *DebugAssert(len > 0); + *while (c) { + * if (c->unpack_float_element_set) { + * return c->unpack_float_element_set(a, index_array, len, val_array); + * } + * c = c->super ? *(c->super) : NULL; + *} + */ + return GRIB_NOT_IMPLEMENTED; +} int grib_unpack_string(grib_accessor* a, char* v, size_t* len) { diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index fe5a9e199..53ce76fb6 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -21,6 +21,7 @@ CLASS = accessor IMPLEMENTS = unpack_long;pack_long; clear IMPLEMENTS = unpack_double;pack_double;unpack_double_element;unpack_double_element_set + IMPLEMENTS = unpack_float IMPLEMENTS = unpack_string;pack_string IMPLEMENTS = unpack_string_array;pack_string_array IMPLEMENTS = unpack_bytes;pack_bytes @@ -56,6 +57,7 @@ static int pack_string_array(grib_accessor*, const char**, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static int unpack_string_array(grib_accessor*, char**, size_t* len); @@ -110,7 +112,7 @@ static grib_accessor_class _grib_accessor_class_gen = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ @@ -339,6 +341,29 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } +static int unpack_float(grib_accessor* a, float* v, size_t* len) +{ + int type = GRIB_TYPE_UNDEFINED; + printf("====%s\n",a->name); + printf("DEBUG unpack_float:: a->cclass->unpack_double=%p\n", (void*)a->cclass->unpack_double); + printf("DEBUG unpack_float:: &unpack_double=%p\n", (void*)&unpack_double); + if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { + double val = 0.0; + size_t l = 1; + grib_unpack_double(a, &val, &l); + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to float", a->name); + return GRIB_SUCCESS; + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as float", a->name); + if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); + } + + return GRIB_NOT_IMPLEMENTED; +} + static int unpack_string(grib_accessor* a, char* v, size_t* len) { if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { diff --git a/src/grib_api.h b/src/grib_api.h index 471754ee1..eba9441ab 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -859,6 +859,7 @@ int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, * @return 0 if OK, integer value on error */ int grib_get_double_array(const grib_handle* h, const char* key, double* vals, size_t* length); +int grib_get_float_array(const grib_handle* h, const char* key, float* vals, size_t* length); /** * Get long array values from a key. If several keys of the same name are present, the last one is returned diff --git a/src/grib_value.c b/src/grib_value.c index f83eef956..47f0dbb4f 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1248,6 +1248,24 @@ int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, doub } } +int _grib_get_float_array_internal(const grib_handle* h, grib_accessor* a, float* val, size_t buffer_len, size_t* decoded_length) +{ + if (a) { + int err = _grib_get_float_array_internal(h, a->same, val, buffer_len, decoded_length); + + if (err == GRIB_SUCCESS) { + size_t len = buffer_len - *decoded_length; + err = grib_unpack_float(a, val + *decoded_length, &len); + *decoded_length += len; + } + + return err; + } + else { + return GRIB_SUCCESS; + } +} + int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length) { int ret = grib_get_double_array(h, name, val, length); @@ -1259,6 +1277,17 @@ int grib_get_double_array_internal(const grib_handle* h, const char* name, doubl return ret; } +int grib_get_float_array_internal(const grib_handle* h, const char* name, float* val, size_t* length) +{ + int ret = grib_get_float_array(h, name, val, length); + + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as float array (%s)", + name, grib_get_error_message(ret)); + + return ret; +} int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length) { @@ -1289,6 +1318,19 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s } } +int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) +{ + size_t len = *length; + grib_accessor* a = grib_find_accessor(h, name); + if(!a) return GRIB_NOT_FOUND; + + /* TODO: For now only GRIB supported... no BUFR keys */ + Assert(name[0]!='/'); + Assert(name[0]!='#'); + *length = 0; + return _grib_get_float_array_internal(h,a,val,len,length); +} + int ecc__grib_get_string_length(grib_accessor* a, size_t* size) { size_t s = 0; From 4dd790f2ff8823b8b4cf648642123f56478fa333 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Dec 2022 17:30:01 +0000 Subject: [PATCH 004/212] ECC-1467: Debugging --- examples/C/grib_get_keys.c | 106 +---------- src/eccodes_prototypes.h | 1 + src/grib_accessor_class_data_simple_packing.c | 178 +++++++++++++++++- src/grib_accessor_class_gen.c | 8 +- src/grib_bits_any_endian_simple.c | 99 ++++++++++ 5 files changed, 285 insertions(+), 107 deletions(-) diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index f17f9458d..484162509 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -1,19 +1,3 @@ -/* - * (C) Copyright 2005- ECMWF. - * - * This software is licensed under the terms of the Apache Licence Version 2.0 - * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. - * - * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by - * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. - */ - -/* - * C Implementation: grib_get_keys - * - * Description: how to get values using keys from GRIB messages - * - */ #include #include #include @@ -22,26 +6,14 @@ int main(int argc, char** argv) { int err = 0; - double* values = NULL; + float* values = NULL; size_t values_len = 0; size_t i = 0, len = 0; - double latitudeOfFirstGridPointInDegrees; - double longitudeOfFirstGridPointInDegrees; - double latitudeOfLastGridPointInDegrees; - double longitudeOfLastGridPointInDegrees; - - double jDirectionIncrementInDegrees; - double iDirectionIncrementInDegrees; - - long numberOfPointsAlongAParallel; - long numberOfPointsAlongAMeridian; - double average = 0; - char* packingType = NULL; FILE* in = NULL; - const char* filename = "../../data/regular_latlon_surface.grib1"; + const char* filename = "../../data/sample.grib2"; codes_handle* h = NULL; in = fopen(filename, "rb"); @@ -58,89 +30,25 @@ int main(int argc, char** argv) } fclose(in); - /* store the filename in the key "file" for this handle */ - len = strlen(filename); - CODES_CHECK(codes_set_string(h, "file", filename, &len), 0); - - /* get as a long*/ - CODES_CHECK(codes_get_long(h, "Ni", &numberOfPointsAlongAParallel), 0); - printf("numberOfPointsAlongAParallel=%ld\n", numberOfPointsAlongAParallel); - - /* get as a long*/ - CODES_CHECK(codes_get_long(h, "Nj", &numberOfPointsAlongAMeridian), 0); - printf("numberOfPointsAlongAMeridian=%ld\n", numberOfPointsAlongAMeridian); - - /* get as a double*/ - CODES_CHECK(codes_get_double(h, "latitudeOfFirstGridPointInDegrees", &latitudeOfFirstGridPointInDegrees), 0); - printf("latitudeOfFirstGridPointInDegrees=%g\n", latitudeOfFirstGridPointInDegrees); - - /* get as a double*/ - CODES_CHECK(codes_get_double(h, "longitudeOfFirstGridPointInDegrees", &longitudeOfFirstGridPointInDegrees), 0); - printf("longitudeOfFirstGridPointInDegrees=%g\n", longitudeOfFirstGridPointInDegrees); - - /* get as a double*/ - CODES_CHECK(codes_get_double(h, "latitudeOfLastGridPointInDegrees", &latitudeOfLastGridPointInDegrees), 0); - printf("latitudeOfLastGridPointInDegrees=%g\n", latitudeOfLastGridPointInDegrees); - - /* get as a double*/ - CODES_CHECK(codes_get_double(h, "longitudeOfLastGridPointInDegrees", &longitudeOfLastGridPointInDegrees), 0); - printf("longitudeOfLastGridPointInDegrees=%g\n", longitudeOfLastGridPointInDegrees); - - /* get as a double*/ - CODES_CHECK(codes_get_double(h, "jDirectionIncrementInDegrees", &jDirectionIncrementInDegrees), 0); - printf("jDirectionIncrementInDegrees=%g\n", jDirectionIncrementInDegrees); - - /* get as a double*/ - CODES_CHECK(codes_get_double(h, "iDirectionIncrementInDegrees", &iDirectionIncrementInDegrees), 0); - printf("iDirectionIncrementInDegrees=%g\n", iDirectionIncrementInDegrees); - - /* get as string */ - CODES_CHECK(codes_get_length(h, "packingType", &len), 0); - packingType = (char*)malloc(len * sizeof(char)); - codes_get_string(h, "packingType", packingType, &len); - printf("packingType=%s\n", packingType); - free(packingType); - /* get the size of the values array*/ CODES_CHECK(codes_get_size(h, "values", &values_len), 0); - values = (double*)malloc(values_len * sizeof(double)); + values = (float*)malloc(values_len * sizeof(float)); /* get data values*/ - CODES_CHECK(codes_get_double_array(h, "values", values, &values_len), 0); + CODES_CHECK(codes_get_float_array(h, "values", values, &values_len), 0); average = 0; - for (i = 0; i < values_len; i++) + for (i = 0; i < values_len; i++){ + //printf("%f\n",values[i]); average += values[i]; + } average /= (double)values_len; free(values); - printf("There are %d values, average is %g\n", (int)values_len, average); - { - int eq = 0; - /* now retrieve the value of the key "file" */ - char file[256] = {0,}; - CODES_CHECK(codes_get_length(h, "file", &len), 0); - assert(len == 1 + strlen(filename)); - codes_get_string(h, "file", file, &len); - eq = strcmp(file, filename); - if (eq != 0) assert(!"file and filename not equal"); - } - - { - /* example of getting bytes */ - const char* name = "reservedNeedNotBePresent"; - unsigned char* byte_val = NULL; - size_t keySize = 0; - CODES_CHECK(codes_get_size(h, name, &keySize), 0); - byte_val = (unsigned char*)malloc(keySize * sizeof(unsigned char)); - GRIB_CHECK(codes_get_bytes(h, name, byte_val, &keySize), name); - free(byte_val); - } - codes_handle_delete(h); return 0; diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 6cb2d8307..79d7abfa6 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1540,6 +1540,7 @@ int grib_encode_size_tb(unsigned char* p, size_t val, long* bitp, long nb); /* grib_bits_any_endian_simple.c */ int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, size_t n_vals, long* val); int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, double* val); +int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, float* val); int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val); int grib_encode_long_array(size_t n_vals, const long* val, long bits_per_value, unsigned char* p, long* off); int grib_encode_double_array(size_t n_vals, const double* val, long bits_per_value, double reference_value, double d, double divisor, unsigned char* p, long* off); diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index d40b6614a..4de2208df 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -23,7 +23,7 @@ CLASS = accessor SUPER = grib_accessor_class_values IMPLEMENTS = init - IMPLEMENTS = unpack_double + IMPLEMENTS = unpack_double;unpack_float IMPLEMENTS = unpack_double_element;unpack_double_element_set IMPLEMENTS = unpack_double_subarray IMPLEMENTS = pack_double @@ -54,6 +54,7 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_double(grib_accessor*, const double* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); @@ -110,7 +111,7 @@ static grib_accessor_class _grib_accessor_class_data_simple_packing = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -150,7 +151,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -317,6 +317,158 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } +// unpack an array of double or single precision real numbers. As doubles if dval!= NULL or floats if fval!=NULL +static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len, unsigned char* buf, long pos, size_t n_vals) +{ + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + int err = 0; + + double reference_value; + long binary_scale_factor; + long bits_per_value; + long decimal_scale_factor; + long offsetBeforeData; + double s = 0; + double d = 0; + double units_factor = 1.0; + double units_bias = 0.0; + Assert( ! (fval && dval) ); +printf("DBG:: SIMPLE PACK unpack real.....\n"); + if (*len < n_vals) { + *len = (long)n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + + /* + * check we don't decode bpv > max(ulong) as it is + * not currently supported by the algorithm + */ + if (bits_per_value > (sizeof(long) * 8)) { + return GRIB_INVALID_BPV; + } + + if (self->units_factor && + (grib_get_double_internal(gh, self->units_factor, &units_factor) == GRIB_SUCCESS)) { + grib_set_double_internal(gh, self->units_factor, 1.0); + } + + if (self->units_bias && + (grib_get_double_internal(gh, self->units_bias, &units_bias) == GRIB_SUCCESS)) { + grib_set_double_internal(gh, self->units_bias, 0.0); + } + + if (n_vals == 0) { + *len = 0; + return GRIB_SUCCESS; + } + + self->dirty = 0; + + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + + /* Special case */ + + if (bits_per_value == 0) { + if (dval) { + for (i = 0; i < n_vals; i++) + dval[i] = reference_value; + } else if (fval) { + for (i = 0; i < n_vals; i++) + fval[i] = reference_value; + } + *len = n_vals; + return GRIB_SUCCESS; + } + + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_data_simple_packing: unpack_double : creating %s, %d values", + a->name, n_vals); + + offsetBeforeData = grib_byte_offset(a); + buf += offsetBeforeData; + + /*Assert(((bits_per_value*n_vals)/8) < (1<<29));*/ /* See GRIB-787 */ + + /* ECC-941 */ + if (!a->context->ieee_packing) { + /* Must turn off this check when the environment variable ECCODES_GRIB_IEEE_PACKING is on */ + long offsetAfterData = 0; + err = grib_get_long(gh, "offsetAfterData", &offsetAfterData); + if (!err && offsetAfterData > offsetBeforeData) { + const long valuesSize = (bits_per_value * n_vals) / 8; /*in bytes*/ + if (offsetBeforeData + valuesSize > offsetAfterData) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "Data section size mismatch: offset before data=%ld, offset after data=%ld (num values=%ld, bits per value=%ld)", + offsetBeforeData, offsetAfterData, n_vals, bits_per_value); + return GRIB_DECODING_ERROR; + } + } +#if 0 + if (offsetBeforeData == offsetAfterData) { + /* Crazy case: Constant field with bitsPerValue > 0 */ + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } +#endif + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "unpack_double: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", + bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); + if(dval) + grib_decode_double_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, dval); + if(fval) + grib_decode_float_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, fval); + + *len = (long)n_vals; + + if(dval) { + if (units_factor != 1.0) { + if (units_bias != 0.0) + for (i = 0; i < n_vals; i++) + dval[i] = dval[i] * units_factor + units_bias; + else + for (i = 0; i < n_vals; i++) + dval[i] *= units_factor; + } + else if (units_bias != 0.0) + for (i = 0; i < n_vals; i++) + dval[i] += units_bias; + } + if(fval) { + if (units_factor != 1.0) { + if (units_bias != 0.0) + for (i = 0; i < n_vals; i++) + fval[i] = fval[i] * units_factor + units_bias; + else + for (i = 0; i < n_vals; i++) + fval[i] *= units_factor; + } + else if (units_bias != 0.0) + for (i = 0; i < n_vals; i++) + fval[i] += units_bias; + } + return err; +} + static int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned char* buf, long pos, size_t n_vals) { grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; @@ -464,7 +616,7 @@ static int unpack_double_subarray(grib_accessor* a, double* val, size_t start, s return _unpack_double(a, val, plen, buf, pos, nvals); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) +static int unpack_double(grib_accessor* a, double* dval, size_t* len) { unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; size_t nvals = 0; @@ -476,8 +628,24 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (err) return err; nvals = count; +printf("SIMPLE unpak double.....\n"); + return _unpack_real(a, dval, NULL, len, buf, pos, nvals); +} + +static int unpack_float(grib_accessor* a, float* fval, size_t* len) +{ + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; + size_t nvals = 0; + long pos = 0; + int err = 0; + long count = 0; - return _unpack_double(a, val, len, buf, pos, nvals); + err = grib_value_count(a, &count); + if (err) + return err; + nvals = count; + printf("SIMPLE unpack float.....\n"); + return _unpack_real(a, NULL, fval, len, buf, pos, nvals); } #if GRIB_IBMPOWER67_OPT diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index 53ce76fb6..777ee7f05 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -343,8 +343,10 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) static int unpack_float(grib_accessor* a, float* v, size_t* len) { - int type = GRIB_TYPE_UNDEFINED; - printf("====%s\n",a->name); + /* int type = GRIB_TYPE_UNDEFINED; + printf("grib_accessor_class_gen.c unpack_float a->name =%s\n",a->name); + printf("grib_accessor_class_gen.c unpack_float a->cclass->name=%s\n",a->cclass->name); + printf("grib_accessor_class_gen.c unpack_float alen=%zu\n",*len); printf("DEBUG unpack_float:: a->cclass->unpack_double=%p\n", (void*)a->cclass->unpack_double); printf("DEBUG unpack_float:: &unpack_double=%p\n", (void*)&unpack_double); if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { @@ -359,7 +361,7 @@ static int unpack_float(grib_accessor* a, float* v, size_t* len) grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as float", a->name); if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); - } + } */ return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_bits_any_endian_simple.c b/src/grib_bits_any_endian_simple.c index 7c00aa4c7..d13308b8c 100644 --- a/src/grib_bits_any_endian_simple.c +++ b/src/grib_bits_any_endian_simple.c @@ -164,6 +164,105 @@ int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerVal return 0; } +/* + * TODO: First lame attempt at decoding a float array. This and the grib_decode_double_array function + * should be merged and refactored! Most probably using C++ templates + */ +/** + * decode an array of n_vals values from an octet-bitstream to float-representation + * + * @param p input bitstream, for technical reasons put into octets + * @param bitp current position in the bitstream + * @param bitsPerValue number of bits needed to build a number (e.g. 8=byte, 16=short, 32=int, but also other sizes allowed) + * @param n_vals number of values to decode + * @param val output, values encoded as 32/64bit numbers + */ +int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, + double reference_value, double s, double d, + size_t n_vals, float* val) +{ + long i = 0; + unsigned long lvalue = 0; + double x; + printf("grib_decode_float_array\n"); + +#if 0 + /* slow reference code */ + int j=0; + for(i=0;i < n_vals;i++) { + lvalue=0; + for(j=0; j< bitsPerValue;j++){ + lvalue <<= 1; + if(grib_get_bit( p, *bitp)) lvalue += 1; + *bitp += 1; + } + x=((lvalue*s)+reference_value)*d; + val[i] = (double)x; + } +#endif + if (bitsPerValue % 8 == 0) { + /* See ECC-386 */ + int bc; + int l = bitsPerValue / 8; + size_t o = 0; + + for (i = 0; i < n_vals; i++) { + lvalue = 0; + lvalue <<= 8; + lvalue |= p[o++]; + + for (bc = 1; bc < l; bc++) { + lvalue <<= 8; + lvalue |= p[o++]; + } + x = ((lvalue * s) + reference_value) * d; + val[i] = (float)x; + /* *bitp += bitsPerValue * n_vals; */ + } + } + else { + unsigned long mask = BIT_MASK1(bitsPerValue); + + /* pi: position of bitp in p[]. >>3 == /8 */ + long pi = *bitp / 8; + /* some bits might of the current byte at pi might be used */ + /* by the previous number usefulBitsInByte gives remaining unused bits */ + /* number of useful bits in current byte */ + int usefulBitsInByte = 8 - (*bitp & 7); + for (i = 0; i < n_vals; i++) { + /* value read as long */ + long bitsToRead = 0; + lvalue = 0; + bitsToRead = bitsPerValue; + /* read one byte after the other to lvalue until >= bitsPerValue are read */ + while (bitsToRead > 0) { + lvalue <<= 8; + lvalue += p[pi]; + pi++; + bitsToRead -= usefulBitsInByte; + usefulBitsInByte = 8; + } + *bitp += bitsPerValue; + /* bitsToRead is now <= 0, remove the last bits */ + lvalue >>= -1 * bitsToRead; + /* set leading bits to 0 - removing bits used for previous number */ + lvalue &= mask; + + usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ + if (usefulBitsInByte > 0) { + pi--; /* reread the current byte */ + } + else { + usefulBitsInByte = 8; /* start with next full byte */ + } + /* scaling and move value to output */ + x = ((lvalue * s) + reference_value) * d; + val[i] = (float)x; + } + } + return 0; +} + int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val) { return GRIB_NOT_IMPLEMENTED; From 573f2f99cc7ffabd89a4fa44bedfab1ccd193978 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Dec 2022 17:54:30 +0000 Subject: [PATCH 005/212] ECC-1467: First working version for simple packing --- examples/C/grib_get_keys.c | 29 ++++--- src/grib_accessor_class_data_apply_bitmap.c | 87 ++++++++++++++++++- src/grib_accessor_class_data_simple_packing.c | 6 +- 3 files changed, 107 insertions(+), 15 deletions(-) diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index 484162509..497e94e55 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -6,11 +6,13 @@ int main(int argc, char** argv) { int err = 0; - float* values = NULL; + float* fvalues = NULL; + double* dvalues = NULL; size_t values_len = 0; - size_t i = 0, len = 0; + size_t i = 0; - double average = 0; + double daverage = 0; + float faverage = 0; FILE* in = NULL; const char* filename = "../../data/sample.grib2"; @@ -33,21 +35,28 @@ int main(int argc, char** argv) /* get the size of the values array*/ CODES_CHECK(codes_get_size(h, "values", &values_len), 0); - values = (float*)malloc(values_len * sizeof(float)); + fvalues = (float*)malloc(values_len * sizeof(float)); + dvalues = (double*)malloc(values_len * sizeof(double)); /* get data values*/ - CODES_CHECK(codes_get_float_array(h, "values", values, &values_len), 0); + CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); + CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); - average = 0; + daverage = 0; + faverage = 0; for (i = 0; i < values_len; i++){ //printf("%f\n",values[i]); - average += values[i]; + faverage += fvalues[i]; + daverage += dvalues[i]; } - average /= (double)values_len; + daverage /= (double)values_len; + faverage /= (double)values_len; - free(values); - printf("There are %d values, average is %g\n", (int)values_len, average); + free(dvalues); + free(fvalues); + printf("There are %d values, double average is %g\n", (int)values_len, daverage); + printf("There are %d values, float average is %f\n", (int)values_len, faverage); codes_handle_delete(h); diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index 5c345ffe5..139f3e3f0 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -18,6 +18,7 @@ SUPER = grib_accessor_class_gen IMPLEMENTS = init IMPLEMENTS = unpack_double;unpack_double_element;unpack_double_element_set + IMPLEMENTS = unpack_float IMPLEMENTS = pack_double IMPLEMENTS = value_count IMPLEMENTS = dump;get_native_type @@ -43,6 +44,7 @@ or edit "accessor.class" and rerun ./make_class.pl static int get_native_type(grib_accessor*); static int pack_double(grib_accessor*, const double* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); @@ -89,7 +91,7 @@ static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -127,7 +129,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -264,6 +265,88 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } +// TODO: Not ideal!! First attempt at unpacking floats... +// Should be merged with unpack_double and refactored! Most probably using C++ templates +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + + size_t i = 0; + size_t j = 0; + size_t n_vals = 0; + long nn = 0; + int err = 0; + size_t coded_n_vals = 0; + float* coded_vals = NULL; + double missing_value = 0; + + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; + + if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) + return grib_get_float_array(grib_handle_of_accessor(a), self->coded_values, val, len); + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if (coded_n_vals == 0) { + for (i = 0; i < n_vals; i++) + val[i] = missing_value; + + *len = n_vals; + return GRIB_SUCCESS; + } + + if ((err = grib_get_float_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) + return err; + + coded_vals = (float*)grib_context_malloc(a->context, coded_n_vals * sizeof(float)); + if (coded_vals == NULL) + return GRIB_OUT_OF_MEMORY; + + if ((err = grib_get_float_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { + grib_context_free(a->context, coded_vals); + return err; + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_class_data_apply_bitmap: unpack_float : creating %s, %d values", + a->name, n_vals); + + for (i = 0; i < n_vals; i++) { + if (val[i] == 0) { + val[i] = missing_value; + } + else { + val[i] = coded_vals[j++]; + if (j > coded_n_vals) { + grib_context_free(a->context, coded_vals); + grib_context_log(a->context, GRIB_LOG_ERROR, + "grib_accessor_class_data_apply_bitmap [%s]:" + " unpack_float : number of coded values does not match bitmap %ld %ld", + a->name, coded_n_vals, n_vals); + + return GRIB_ARRAY_TOO_SMALL; + } + } + } + + *len = n_vals; + + grib_context_free(a->context, coded_vals); + return err; +} + static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 4de2208df..3931cfeed 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -336,7 +336,7 @@ static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len double units_factor = 1.0; double units_bias = 0.0; Assert( ! (fval && dval) ); -printf("DBG:: SIMPLE PACK unpack real.....\n"); + if (*len < n_vals) { *len = (long)n_vals; return GRIB_ARRAY_TOO_SMALL; @@ -628,7 +628,7 @@ static int unpack_double(grib_accessor* a, double* dval, size_t* len) if (err) return err; nvals = count; -printf("SIMPLE unpak double.....\n"); + return _unpack_real(a, dval, NULL, len, buf, pos, nvals); } @@ -644,7 +644,7 @@ static int unpack_float(grib_accessor* a, float* fval, size_t* len) if (err) return err; nvals = count; - printf("SIMPLE unpack float.....\n"); + return _unpack_real(a, NULL, fval, len, buf, pos, nvals); } From 445798caa764d44594bf5df372e2ba41ffb4e918 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Dec 2022 21:27:26 +0000 Subject: [PATCH 006/212] ECC-1467: Testing --- examples/C/grib_get_keys.c | 114 +++++++++++++++++++++++++++++++++---- 1 file changed, 103 insertions(+), 11 deletions(-) diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index 497e94e55..537c719ea 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -1,3 +1,19 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +/* + * C Implementation: grib_get_keys + * + * Description: how to get values using keys from GRIB messages + * + */ #include #include #include @@ -6,16 +22,28 @@ int main(int argc, char** argv) { int err = 0; - float* fvalues = NULL; - double* dvalues = NULL; + float* fvalues = NULL; /* data values as floats */ + double* dvalues = NULL; /* data values as doubles */ size_t values_len = 0; - size_t i = 0; + size_t i = 0, len = 0; + + double latitudeOfFirstGridPointInDegrees; + double longitudeOfFirstGridPointInDegrees; + double latitudeOfLastGridPointInDegrees; + double longitudeOfLastGridPointInDegrees; + + double jDirectionIncrementInDegrees; + double iDirectionIncrementInDegrees; + + long numberOfPointsAlongAParallel; + long numberOfPointsAlongAMeridian; double daverage = 0; float faverage = 0; + char* packingType = NULL; FILE* in = NULL; - const char* filename = "../../data/sample.grib2"; + const char* filename = "../../data/regular_latlon_surface.grib1"; codes_handle* h = NULL; in = fopen(filename, "rb"); @@ -32,6 +60,49 @@ int main(int argc, char** argv) } fclose(in); + /* store the filename in the key "file" for this handle */ + len = strlen(filename); + CODES_CHECK(codes_set_string(h, "file", filename, &len), 0); + + /* get as a long*/ + CODES_CHECK(codes_get_long(h, "Ni", &numberOfPointsAlongAParallel), 0); + printf("numberOfPointsAlongAParallel=%ld\n", numberOfPointsAlongAParallel); + + /* get as a long*/ + CODES_CHECK(codes_get_long(h, "Nj", &numberOfPointsAlongAMeridian), 0); + printf("numberOfPointsAlongAMeridian=%ld\n", numberOfPointsAlongAMeridian); + + /* get as a double*/ + CODES_CHECK(codes_get_double(h, "latitudeOfFirstGridPointInDegrees", &latitudeOfFirstGridPointInDegrees), 0); + printf("latitudeOfFirstGridPointInDegrees=%g\n", latitudeOfFirstGridPointInDegrees); + + /* get as a double*/ + CODES_CHECK(codes_get_double(h, "longitudeOfFirstGridPointInDegrees", &longitudeOfFirstGridPointInDegrees), 0); + printf("longitudeOfFirstGridPointInDegrees=%g\n", longitudeOfFirstGridPointInDegrees); + + /* get as a double*/ + CODES_CHECK(codes_get_double(h, "latitudeOfLastGridPointInDegrees", &latitudeOfLastGridPointInDegrees), 0); + printf("latitudeOfLastGridPointInDegrees=%g\n", latitudeOfLastGridPointInDegrees); + + /* get as a double*/ + CODES_CHECK(codes_get_double(h, "longitudeOfLastGridPointInDegrees", &longitudeOfLastGridPointInDegrees), 0); + printf("longitudeOfLastGridPointInDegrees=%g\n", longitudeOfLastGridPointInDegrees); + + /* get as a double*/ + CODES_CHECK(codes_get_double(h, "jDirectionIncrementInDegrees", &jDirectionIncrementInDegrees), 0); + printf("jDirectionIncrementInDegrees=%g\n", jDirectionIncrementInDegrees); + + /* get as a double*/ + CODES_CHECK(codes_get_double(h, "iDirectionIncrementInDegrees", &iDirectionIncrementInDegrees), 0); + printf("iDirectionIncrementInDegrees=%g\n", iDirectionIncrementInDegrees); + + /* get as string */ + CODES_CHECK(codes_get_length(h, "packingType", &len), 0); + packingType = (char*)malloc(len * sizeof(char)); + codes_get_string(h, "packingType", packingType, &len); + printf("packingType=%s\n", packingType); + free(packingType); + /* get the size of the values array*/ CODES_CHECK(codes_get_size(h, "values", &values_len), 0); @@ -42,21 +113,42 @@ int main(int argc, char** argv) CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); - daverage = 0; faverage = 0; - for (i = 0; i < values_len; i++){ - //printf("%f\n",values[i]); + daverage = 0; + for (i = 0; i < values_len; i++) { faverage += fvalues[i]; daverage += dvalues[i]; } + faverage /= (float)values_len; daverage /= (double)values_len; - faverage /= (double)values_len; - free(dvalues); free(fvalues); - printf("There are %d values, double average is %g\n", (int)values_len, daverage); - printf("There are %d values, float average is %f\n", (int)values_len, faverage); + free(dvalues); + printf("There are %zu values, double average is %g\n", values_len, daverage); + printf("There are %zu values, float average is %f\n", values_len, faverage); + + { + int eq = 0; + /* now retrieve the value of the key "file" */ + char file[256] = {0,}; + CODES_CHECK(codes_get_length(h, "file", &len), 0); + assert(len == 1 + strlen(filename)); + codes_get_string(h, "file", file, &len); + eq = strcmp(file, filename); + if (eq != 0) assert(!"file and filename not equal"); + } + + { + /* example of getting bytes */ + const char* name = "reservedNeedNotBePresent"; + unsigned char* byte_val = NULL; + size_t keySize = 0; + CODES_CHECK(codes_get_size(h, name, &keySize), 0); + byte_val = (unsigned char*)malloc(keySize * sizeof(unsigned char)); + GRIB_CHECK(codes_get_bytes(h, name, byte_val, &keySize), name); + free(byte_val); + } codes_handle_delete(h); From 8d55550732c727ad426c7fa82eba0d049bfd918d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 29 Dec 2022 21:41:43 +0000 Subject: [PATCH 007/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 03) --- src/grib_accessor_class_data_ccsds_packing.c | 121 ++++++++++++++++++- 1 file changed, 119 insertions(+), 2 deletions(-) diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 4abf36b17..d613e5390 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -18,6 +18,7 @@ SUPER = grib_accessor_class_values IMPLEMENTS = init IMPLEMENTS = unpack_double + IMPLEMENTS = unpack_float IMPLEMENTS = pack_double IMPLEMENTS = unpack_double_element;unpack_double_element_set IMPLEMENTS = value_count @@ -49,6 +50,7 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_double(grib_accessor*, const double* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); @@ -103,7 +105,7 @@ static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -143,7 +145,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -329,6 +330,117 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } +// TODO: Not ideal!! First attempt at unpacking floats... +// Should be merged with unpack_double and refactored! Most probably using C++ templates +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + int err = GRIB_SUCCESS, i = 0; + size_t buflen = 0; + struct aec_stream strm; + double bscale = 0; + double dscale = 0; + unsigned char* buf = NULL; + size_t n_vals = 0; + size_t size = 0; + unsigned char* decoded = NULL; + /*unsigned char* p = NULL;*/ + long pos = 0; + long nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + long bits8; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + + self->dirty = 0; + + if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + return err; + n_vals = nn; + + if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + + /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) + return err; + + /* TODO: This should be called upstream */ + if (*len < n_vals) + return GRIB_ARRAY_TOO_SMALL; + + /* Special case */ + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } + + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); + + buflen = grib_byte_count(a); + buf = (unsigned char*)hand->buffer->data; + buf += grib_byte_offset(a); + + strm.flags = ccsds_flags; + strm.bits_per_sample = bits_per_value; + strm.block_size = ccsds_block_size; + strm.rsi = ccsds_rsi; + + strm.next_in = buf; + strm.avail_in = buflen; + + bits8 = ((bits_per_value + 7) / 8) * 8; + size = n_vals * ((bits_per_value + 7) / 8); + decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); + if (!decoded) { + err = GRIB_OUT_OF_MEMORY; + goto cleanup; + } + strm.next_out = decoded; + strm.avail_out = size; + + if (hand->context->debug) print_aec_stream_info(&strm, "unpack_float"); + + if ((err = aec_buffer_decode(&strm)) != AEC_OK) { + grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS unpack_float: aec_buffer_decode error %d (%s)\n", + err, aec_get_error_message(err)); + err = GRIB_ENCODING_ERROR; + goto cleanup; + } + + pos = 0; + + /* ECC-1427: Performance improvement */ + grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + *len = n_vals; + +cleanup: + grib_context_buffer_free(a->context, decoded); + return err; +} + static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; @@ -676,6 +788,11 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + print_error_feature_not_enabled(a->context); + return GRIB_FUNCTIONALITY_NOT_ENABLED; +} static int pack_double(grib_accessor* a, const double* val, size_t* len) { print_error_feature_not_enabled(a->context); From e0e4655d3e42b8a9c4e6683450f3c877436a313c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 13:59:47 +0000 Subject: [PATCH 008/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 04) --- src/grib_accessor.c | 1 + src/grib_accessor_class_bitmap.c | 31 +++++++++++++++++-- src/grib_accessor_class_data_apply_bitmap.c | 4 +-- src/grib_accessor_class_data_ccsds_packing.c | 4 +-- src/grib_accessor_class_data_simple_packing.c | 6 +++- src/grib_accessor_class_gen.c | 21 +------------ src/grib_value.c | 1 + 7 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/grib_accessor.c b/src/grib_accessor.c index 51b603626..ddcafeef9 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -226,6 +226,7 @@ int grib_unpack_float(grib_accessor* a, float* v, size_t* len) { grib_accessor_class* c = a->cclass; while (c) { + /* printf("grib_accessor.c grib_unpack_float:: c->name=%s\n",c->name); */ if (c->unpack_float) { return c->unpack_float(a, v, len); } diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index 266fc937a..b0dda5d52 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -18,6 +18,7 @@ IMPLEMENTS = next_offset IMPLEMENTS = unpack_double;unpack_double_element;unpack_double_element_set + IMPLEMENTS = unpack_float IMPLEMENTS = unpack_long IMPLEMENTS = unpack_string IMPLEMENTS = init;dump;update_size @@ -40,6 +41,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static long next_offset(grib_accessor*); @@ -88,7 +90,7 @@ static grib_accessor_class _grib_accessor_class_bitmap = { 0, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -127,7 +129,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->pack_double = (*(c->super))->pack_double; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->pack_string_array = (*(c->super))->pack_string_array; c->unpack_string_array = (*(c->super))->unpack_string_array; @@ -267,6 +268,32 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } +//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + long pos = a->offset * 8; + long tlen; + long i; + int err = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + err = grib_value_count(a, &tlen); + if (err) + return err; + + if (*len < tlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < tlen; i++) { + val[i] = (float)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); + } + *len = tlen; + return GRIB_SUCCESS; +} +// static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { long pos = a->offset * 8; diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index 139f3e3f0..f0eaed5e3 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -265,8 +265,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -// TODO: Not ideal!! First attempt at unpacking floats... -// Should be merged with unpack_double and refactored! Most probably using C++ templates +//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// Should be merged with unpack_double and refactored! Most probably using C++ templates static int unpack_float(grib_accessor* a, float* val, size_t* len) { grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index d613e5390..85088f764 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -330,8 +330,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -// TODO: Not ideal!! First attempt at unpacking floats... -// Should be merged with unpack_double and refactored! Most probably using C++ templates +//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// Should be merged with unpack_double and refactored! Most probably using C++ templates static int unpack_float(grib_accessor* a, float* val, size_t* len) { grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 3931cfeed..06a039ec4 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -317,7 +317,9 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -// unpack an array of double or single precision real numbers. As doubles if dval!= NULL or floats if fval!=NULL +// unpack an array of double-precision (double) or single-precision (float) real numbers. +// As doubles if dval!=NULL +// As floats if fval!=NULL static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len, unsigned char* buf, long pos, size_t n_vals) { grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; @@ -335,6 +337,8 @@ static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len double d = 0; double units_factor = 1.0; double units_bias = 0.0; + + // Either decode as double or float: cannot have both! Assert( ! (fval && dval) ); if (*len < n_vals) { diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index 777ee7f05..29e0f952b 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -341,28 +341,9 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } +//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! static int unpack_float(grib_accessor* a, float* v, size_t* len) { - /* int type = GRIB_TYPE_UNDEFINED; - printf("grib_accessor_class_gen.c unpack_float a->name =%s\n",a->name); - printf("grib_accessor_class_gen.c unpack_float a->cclass->name=%s\n",a->cclass->name); - printf("grib_accessor_class_gen.c unpack_float alen=%zu\n",*len); - printf("DEBUG unpack_float:: a->cclass->unpack_double=%p\n", (void*)a->cclass->unpack_double); - printf("DEBUG unpack_float:: &unpack_double=%p\n", (void*)&unpack_double); - if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { - double val = 0.0; - size_t l = 1; - grib_unpack_double(a, &val, &l); - *v = val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to float", a->name); - return GRIB_SUCCESS; - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as float", a->name); - if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); - } */ - return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_value.c b/src/grib_value.c index 47f0dbb4f..46132b0db 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1318,6 +1318,7 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s } } +//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) { size_t len = *length; From f16ba7176f7e497fd0436d817908c5390a63ddb8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 14:16:58 +0000 Subject: [PATCH 009/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 04) --- src/grib_bits_any_endian_simple.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/grib_bits_any_endian_simple.c b/src/grib_bits_any_endian_simple.c index d13308b8c..e428f68d5 100644 --- a/src/grib_bits_any_endian_simple.c +++ b/src/grib_bits_any_endian_simple.c @@ -164,19 +164,9 @@ int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerVal return 0; } -/* - * TODO: First lame attempt at decoding a float array. This and the grib_decode_double_array function - * should be merged and refactored! Most probably using C++ templates - */ -/** - * decode an array of n_vals values from an octet-bitstream to float-representation - * - * @param p input bitstream, for technical reasons put into octets - * @param bitp current position in the bitstream - * @param bitsPerValue number of bits needed to build a number (e.g. 8=byte, 16=short, 32=int, but also other sizes allowed) - * @param n_vals number of values to decode - * @param val output, values encoded as 32/64bit numbers - */ +//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// This and the grib_decode_double_array function +// should be merged and refactored! Most probably using C++ templates int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, float* val) @@ -184,7 +174,6 @@ int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValu long i = 0; unsigned long lvalue = 0; double x; - printf("grib_decode_float_array\n"); #if 0 /* slow reference code */ From 5fea28e19bafb788a3617b45849b3a4081f27408 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 15:53:10 +0000 Subject: [PATCH 010/212] ECC-1467: Added test --- tests/CMakeLists.txt | 2 + tests/grib_ecc-1467.c | 91 ++++++++++++++++++++++++++++++++++++++++++ tests/grib_ecc-1467.sh | 32 +++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 tests/grib_ecc-1467.c create mode 100755 tests/grib_ecc-1467.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 86f450af7..4a7e88a0e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,6 +32,7 @@ list(APPEND test_c_bins grib_optimize_scaling_sh grib_set_force grib_ecc-386 + grib_ecc-1467 bufr_ecc-517 bufr_ecc-1288 bufr_get_element @@ -211,6 +212,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1030 grib_ecc-1397 grib_ecc-1425 + grib_ecc-1467 grib_set_bytes grib_set_force bufr_ecc-556 diff --git a/tests/grib_ecc-1467.c b/tests/grib_ecc-1467.c new file mode 100644 index 000000000..496925a76 --- /dev/null +++ b/tests/grib_ecc-1467.c @@ -0,0 +1,91 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ +#include +#include +#undef NDEBUG +#include +#include "eccodes.h" + +int main(int argc, char** argv) +{ + int err = 0; + float* fvalues = NULL; /* data values as floats */ + double* dvalues = NULL; /* data values as doubles */ + size_t values_len = 0; // number of data points + size_t cvalues_len = 0; // coded values excluding missing + size_t i = 0; + int mode = 2; // 1=single-precision, 2=double-precision + + double daverage = 0; + float faverage = 0; + + FILE* in = NULL; + const char* filename = 0; + codes_handle* h = NULL; + + if (argc!=3) {fprintf(stderr,"usage: %s mode file\n",argv[0]); return 1;} + if (strcmp(argv[1], "double")==0) mode=2; + if (strcmp(argv[1], "float")==0) mode=1; + filename = argv[2]; + + printf("Opening %s, mode=%d\n",filename, mode); + in = fopen(filename, "rb"); + assert(in); + + /* create new handle from the first message in the file*/ + h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); + assert(h); + fclose(in); + + /* get the size of the values array*/ + CODES_CHECK(codes_get_size(h, "values", &values_len), 0); + + if (mode==1) + fvalues = (float*)malloc(values_len * sizeof(float)); + if (mode==2) + dvalues = (double*)malloc(values_len * sizeof(double)); + + /* get data values*/ + if(mode==1) + CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); + if(mode==2) + CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); + + faverage = 0; + daverage = 0; + if(mode==1) { + for (i = 0; i < values_len; i++) { + if (fvalues[i] != 9999) { + //if(i<10)printf("%10.15f\n",fvalues[i]); + faverage += fvalues[i]; + cvalues_len++; + } + } + faverage /= (float)cvalues_len; + free(fvalues); + printf("\tThere are %zu total values, %zu coded, float average = %10.15f\n", values_len, cvalues_len, faverage); + } + if (mode==2){ + for (i = 0; i < values_len; i++) { + if (dvalues[i] != 9999) { + //if(i<10)printf("%10.15f\n",dvalues[i]); + daverage += dvalues[i]; + cvalues_len++; + } + } + daverage /= (double)cvalues_len; + free(dvalues); + printf("\tThere are %zu total values, %zu coded, double average = %10.15g\n", values_len, cvalues_len, daverage); + } + + codes_handle_delete(h); + + return 0; +} diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh new file mode 100755 index 000000000..a38df98ca --- /dev/null +++ b/tests/grib_ecc-1467.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +gfiles=" + sst_globus0083.grib + constant_field.grib1 + constant_field.grib2 + reduced_latlon_surface.grib1 + reduced_latlon_surface.grib2 + regular_latlon_surface.grib1 + regular_latlon_surface.grib2 +" +if [ $HAVE_AEC -eq 1 ]; then + echo "Adding extra files (HAVE_AEC=1)" + gfiles="ccsds.grib2 "$gfiles +fi + +for f in $gfiles; do + input=${data_dir}/$f + ${tools_dir}/grib_ls -p numberOfDataPoints,numberOfCodedValues,numberOfMissing,avg $input + $EXEC ${test_dir}/grib_ecc-1467 double $input + $EXEC ${test_dir}/grib_ecc-1467 float $input +done From ff77426de8c7d42d7f9dfdef450d1336e1aa6a93 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 16:42:23 +0000 Subject: [PATCH 011/212] ECC-1467: Cleanup --- src/grib_value.c | 6 +++++- tests/grib_ecc-1467.c | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/grib_value.c b/src/grib_value.c index 46132b0db..ffbad3cc7 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1323,9 +1323,13 @@ int grib_get_float_array(const grib_handle* h, const char* name, float* val, siz { size_t len = *length; grib_accessor* a = grib_find_accessor(h, name); - if(!a) return GRIB_NOT_FOUND; + if (!a) return GRIB_NOT_FOUND; /* TODO: For now only GRIB supported... no BUFR keys */ + if (h->product_kind != PRODUCT_GRIB) { + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_float_array only supported for GRIB"); + return GRIB_NOT_IMPLEMENTED; + } Assert(name[0]!='/'); Assert(name[0]!='#'); *length = 0; diff --git a/tests/grib_ecc-1467.c b/tests/grib_ecc-1467.c index 496925a76..809c6c346 100644 --- a/tests/grib_ecc-1467.c +++ b/tests/grib_ecc-1467.c @@ -32,10 +32,11 @@ int main(int argc, char** argv) if (argc!=3) {fprintf(stderr,"usage: %s mode file\n",argv[0]); return 1;} if (strcmp(argv[1], "double")==0) mode=2; - if (strcmp(argv[1], "float")==0) mode=1; + else if (strcmp(argv[1], "float")==0) mode=1; + else { fprintf(stderr,"Invalid mode: Use float or double\n");return 1; } filename = argv[2]; - printf("Opening %s, mode=%d\n",filename, mode); + printf( "Opening %s, mode=%s\n",filename, (mode==1?"float":"double") ); in = fopen(filename, "rb"); assert(in); From 4cb2e123e1c7dff1461b5bc18498b6f15c55d5b5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 16:52:23 +0000 Subject: [PATCH 012/212] ECC-1467: Add grib_accessors_list_unpack_float --- src/eccodes_prototypes.h | 1 + src/grib_accessor.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 79d7abfa6..f9d1524e1 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -133,6 +133,7 @@ int grib_unpack_string(grib_accessor* a, char* v, size_t* len); int grib_unpack_string_array(grib_accessor* a, char** v, size_t* len); int grib_accessors_list_unpack_long(grib_accessors_list* al, long* val, size_t* buffer_len); int grib_accessors_list_unpack_double(grib_accessors_list* al, double* val, size_t* buffer_len); +int grib_accessors_list_unpack_float(grib_accessors_list* al, float* val, size_t* buffer_len); int grib_accessors_list_unpack_string(grib_accessors_list* al, char** val, size_t* buffer_len); int grib_unpack_long(grib_accessor* a, long* v, size_t* len); long grib_accessor_get_native_type(grib_accessor* a); diff --git a/src/grib_accessor.c b/src/grib_accessor.c index ddcafeef9..82bedf11f 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -351,6 +351,23 @@ int grib_accessors_list_unpack_double(grib_accessors_list* al, double* val, size return err; } +int grib_accessors_list_unpack_float(grib_accessors_list* al, float* val, size_t* buffer_len) +{ + int err = GRIB_SUCCESS; + size_t unpacked_len = 0; + size_t len = 0; + + while (al && err == GRIB_SUCCESS) { + len = *buffer_len - unpacked_len; + err = grib_unpack_float(al->accessor, val + unpacked_len, &len); + unpacked_len += len; + al = al->next; + } + + *buffer_len = unpacked_len; + return err; +} + int grib_accessors_list_unpack_string(grib_accessors_list* al, char** val, size_t* buffer_len) { int err = GRIB_SUCCESS; From cc4ef5a62d49376ff0276978a90bd4e79a1abc88 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 17:13:20 +0000 Subject: [PATCH 013/212] ECC-1467: Add codes_keys_iterator_get_float --- src/eccodes.c | 6 ++++++ src/eccodes.h | 1 + src/eccodes_prototypes.h | 1 + src/grib_api.h | 1 + src/grib_keys_iterator.c | 4 ++++ 5 files changed, 13 insertions(+) diff --git a/src/eccodes.c b/src/eccodes.c index ec5e538e3..8c696788e 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -472,10 +472,16 @@ int codes_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_ { return grib_keys_iterator_get_long(kiter, v, len); } + int codes_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len) { return grib_keys_iterator_get_double(kiter, v, len); } +int codes_keys_iterator_get_float(const grib_keys_iterator* kiter, float* v, size_t* len) +{ + return grib_keys_iterator_get_float(kiter, v, len); +} + int codes_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len) { return grib_keys_iterator_get_string(kiter, v, len); diff --git a/src/eccodes.h b/src/eccodes.h index dfe7d53be..d65c53cec 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -1316,6 +1316,7 @@ int codes_keys_iterator_rewind(codes_keys_iterator* kiter); int codes_keys_iterator_set_flags(codes_keys_iterator* kiter, unsigned long flags); int codes_keys_iterator_get_long(const codes_keys_iterator* kiter, long* v, size_t* len); int codes_keys_iterator_get_double(const codes_keys_iterator* kiter, double* v, size_t* len); +int codes_keys_iterator_get_float(const codes_keys_iterator* kiter, float* v, size_t* len); int codes_keys_iterator_get_string(const codes_keys_iterator* kiter, char* v, size_t* len); int codes_keys_iterator_get_bytes(const codes_keys_iterator* kiter, unsigned char* v, size_t* len); diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index f9d1524e1..f0d38bcb8 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1153,6 +1153,7 @@ grib_accessor* grib_keys_iterator_get_accessor(grib_keys_iterator* kiter); int grib_keys_iterator_delete(grib_keys_iterator* kiter); int grib_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len); int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len); +int grib_keys_iterator_get_float(const grib_keys_iterator* kiter, float* v, size_t* len); int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len); int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len); int grib_keys_iterator_get_native_type(const grib_keys_iterator* kiter); diff --git a/src/grib_api.h b/src/grib_api.h index eba9441ab..bc7f5fb51 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -1319,6 +1319,7 @@ int grib_keys_iterator_set_flags(grib_keys_iterator* kiter, unsigned long flags) int grib_keys_iterator_get_long(const grib_keys_iterator* kiter, long* v, size_t* len); int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, size_t* len); +int grib_keys_iterator_get_float(const grib_keys_iterator* kiter, float* v, size_t* len); int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len); int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len); int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type); diff --git a/src/grib_keys_iterator.c b/src/grib_keys_iterator.c index aebff8095..854b4a2c5 100644 --- a/src/grib_keys_iterator.c +++ b/src/grib_keys_iterator.c @@ -207,6 +207,10 @@ int grib_keys_iterator_get_double(const grib_keys_iterator* kiter, double* v, si { return grib_unpack_double(kiter->current, v, len); } +int grib_keys_iterator_get_float(const grib_keys_iterator* kiter, float* v, size_t* len) +{ + return grib_unpack_float(kiter->current, v, len); +} int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size_t* len) { From c36ac36a2999189e5415a1c98a9736bbefcac22f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 30 Dec 2022 18:19:31 +0000 Subject: [PATCH 014/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 05) --- src/accessor.class | 4 +++ src/eccodes.c | 10 ++++++ src/eccodes.h | 2 ++ src/eccodes_prototypes.h | 6 ++++ ...grib_accessor_class_abstract_long_vector.c | 4 +++ src/grib_accessor_class_abstract_vector.c | 4 +++ src/grib_accessor_class_apply_operators.c | 4 +++ src/grib_accessor_class_array.c | 4 +++ src/grib_accessor_class_ascii.c | 4 +++ src/grib_accessor_class_assert.c | 4 +++ src/grib_accessor_class_bit.c | 4 +++ src/grib_accessor_class_bitmap.c | 4 +++ src/grib_accessor_class_bits.c | 4 +++ src/grib_accessor_class_bits_per_value.c | 4 +++ src/grib_accessor_class_blob.c | 4 +++ src/grib_accessor_class_box.c | 4 +++ src/grib_accessor_class_budgdate.c | 4 +++ src/grib_accessor_class_bufr_data_array.c | 4 +++ src/grib_accessor_class_bufr_data_element.c | 4 +++ src/grib_accessor_class_bufr_elements_table.c | 4 +++ ...accessor_class_bufr_extract_area_subsets.c | 4 +++ ...ssor_class_bufr_extract_datetime_subsets.c | 4 +++ ...grib_accessor_class_bufr_extract_subsets.c | 4 +++ src/grib_accessor_class_bufr_group.c | 4 +++ ...grib_accessor_class_bufr_simple_thinning.c | 4 +++ src/grib_accessor_class_bufr_string_values.c | 4 +++ ...cessor_class_bufrdc_expanded_descriptors.c | 4 +++ src/grib_accessor_class_bytes.c | 4 +++ ...or_class_change_alternative_row_scanning.c | 4 +++ ...accessor_class_change_scanning_direction.c | 4 +++ ...ib_accessor_class_check_internal_version.c | 4 +++ src/grib_accessor_class_closest_date.c | 4 +++ src/grib_accessor_class_codeflag.c | 4 +++ src/grib_accessor_class_codetable.c | 4 +++ src/grib_accessor_class_codetable_title.c | 4 +++ src/grib_accessor_class_codetable_units.c | 4 +++ src/grib_accessor_class_concept.c | 4 +++ src/grib_accessor_class_constant.c | 4 +++ src/grib_accessor_class_count_file.c | 4 +++ src/grib_accessor_class_count_missing.c | 4 +++ src/grib_accessor_class_count_total.c | 4 +++ src/grib_accessor_class_data_2order_packing.c | 4 +++ src/grib_accessor_class_data_apply_bitmap.c | 4 +++ ...ccessor_class_data_apply_boustrophedonic.c | 4 +++ ..._class_data_apply_boustrophedonic_bitmap.c | 4 +++ ..._accessor_class_data_apply_gdsnotpresent.c | 4 +++ src/grib_accessor_class_data_ccsds_packing.c | 4 +++ ...grib_accessor_class_data_complex_packing.c | 4 +++ src/grib_accessor_class_data_dummy_field.c | 4 +++ ...ib_accessor_class_data_g1complex_packing.c | 4 +++ ...ta_g1second_order_constant_width_packing.c | 4 +++ ..._g1second_order_general_extended_packing.c | 4 +++ ...lass_data_g1second_order_general_packing.c | 4 +++ ...s_data_g1second_order_row_by_row_packing.c | 4 +++ ...b_accessor_class_data_g1secondary_bitmap.c | 4 +++ ...b_accessor_class_data_g1shsimple_packing.c | 4 +++ ...rib_accessor_class_data_g1simple_packing.c | 4 +++ ...rib_accessor_class_data_g22order_packing.c | 4 +++ ..._accessor_class_data_g2bifourier_packing.c | 4 +++ ...ib_accessor_class_data_g2complex_packing.c | 4 +++ ...b_accessor_class_data_g2secondary_bitmap.c | 4 +++ ...b_accessor_class_data_g2shsimple_packing.c | 4 +++ ...rib_accessor_class_data_g2simple_packing.c | 4 +++ ...data_g2simple_packing_with_preprocessing.c | 4 +++ ...rib_accessor_class_data_jpeg2000_packing.c | 4 +++ src/grib_accessor_class_data_png_packing.c | 4 +++ src/grib_accessor_class_data_raw_packing.c | 4 +++ ...rib_accessor_class_data_secondary_bitmap.c | 4 +++ src/grib_accessor_class_data_sh_packed.c | 4 +++ src/grib_accessor_class_data_sh_unpacked.c | 4 +++ ...rib_accessor_class_data_shsimple_packing.c | 4 +++ src/grib_accessor_class_data_simple_packing.c | 4 +++ src/grib_accessor_class_decimal_precision.c | 4 +++ src/grib_accessor_class_dictionary.c | 4 +++ src/grib_accessor_class_dirty.c | 4 +++ src/grib_accessor_class_divdouble.c | 4 +++ src/grib_accessor_class_double.c | 4 +++ src/grib_accessor_class_element.c | 4 +++ src/grib_accessor_class_evaluate.c | 4 +++ ...grib_accessor_class_expanded_descriptors.c | 4 +++ src/grib_accessor_class_forward.c | 4 +++ ...sor_class_from_scale_factor_scaled_value.c | 4 +++ ...rib_accessor_class_g1_half_byte_codeflag.c | 4 +++ src/grib_accessor_class_g1_message_length.c | 4 +++ src/grib_accessor_class_g1_section4_length.c | 4 +++ src/grib_accessor_class_g1area.c | 4 +++ src/grib_accessor_class_g1bitmap.c | 4 +++ src/grib_accessor_class_g1date.c | 4 +++ ...ib_accessor_class_g1day_of_the_year_date.c | 4 +++ ...accessor_class_g1end_of_interval_monthly.c | 4 +++ src/grib_accessor_class_g1fcperiod.c | 4 +++ src/grib_accessor_class_g1forecastmonth.c | 4 +++ src/grib_accessor_class_g1monthlydate.c | 4 +++ ...lass_g1number_of_coded_values_sh_complex.c | 4 +++ ...class_g1number_of_coded_values_sh_simple.c | 4 +++ src/grib_accessor_class_g1step_range.c | 4 +++ src/grib_accessor_class_g1verificationdate.c | 4 +++ src/grib_accessor_class_g2_aerosol.c | 4 +++ src/grib_accessor_class_g2_chemical.c | 4 +++ src/grib_accessor_class_g2_eps.c | 4 +++ src/grib_accessor_class_g2_mars_labeling.c | 4 +++ src/grib_accessor_class_g2bitmap.c | 4 +++ src/grib_accessor_class_g2bitmap_present.c | 4 +++ src/grib_accessor_class_g2date.c | 4 +++ src/grib_accessor_class_g2end_step.c | 4 +++ src/grib_accessor_class_g2grid.c | 4 +++ src/grib_accessor_class_g2latlon.c | 4 +++ src/grib_accessor_class_g2level.c | 4 +++ src/grib_accessor_class_g2lon.c | 4 +++ src/grib_accessor_class_g2step_range.c | 4 +++ src/grib_accessor_class_gaussian_grid_name.c | 4 +++ src/grib_accessor_class_gds_is_present.c | 4 +++ ...ib_accessor_class_gds_not_present_bitmap.c | 4 +++ src/grib_accessor_class_gen.c | 2 ++ src/grib_accessor_class_getenv.c | 4 +++ src/grib_accessor_class_global_gaussian.c | 4 +++ src/grib_accessor_class_group.c | 4 +++ src/grib_accessor_class_gts_header.c | 4 +++ src/grib_accessor_class_hash_array.c | 4 +++ src/grib_accessor_class_headers_only.c | 4 +++ src/grib_accessor_class_ibmfloat.c | 4 +++ src/grib_accessor_class_ieeefloat.c | 4 +++ src/grib_accessor_class_ifs_param.c | 4 +++ src/grib_accessor_class_int16.c | 4 +++ src/grib_accessor_class_int16_little_endian.c | 4 +++ src/grib_accessor_class_int32.c | 4 +++ src/grib_accessor_class_int32_little_endian.c | 4 +++ src/grib_accessor_class_int64.c | 4 +++ src/grib_accessor_class_int64_little_endian.c | 4 +++ src/grib_accessor_class_int8.c | 4 +++ src/grib_accessor_class_iterator.c | 4 +++ src/grib_accessor_class_julian_date.c | 4 +++ src/grib_accessor_class_julian_day.c | 4 +++ src/grib_accessor_class_ksec1expver.c | 4 +++ src/grib_accessor_class_label.c | 4 +++ src/grib_accessor_class_laplacian.c | 4 +++ src/grib_accessor_class_latitudes.c | 4 +++ src/grib_accessor_class_latlon_increment.c | 4 +++ src/grib_accessor_class_latlonvalues.c | 4 +++ src/grib_accessor_class_library_version.c | 4 +++ src/grib_accessor_class_local_definition.c | 4 +++ src/grib_accessor_class_long.c | 4 +++ src/grib_accessor_class_long_vector.c | 4 +++ src/grib_accessor_class_longitudes.c | 4 +++ src/grib_accessor_class_lookup.c | 4 +++ src/grib_accessor_class_mars_param.c | 4 +++ src/grib_accessor_class_mars_step.c | 4 +++ src/grib_accessor_class_md5.c | 4 +++ src/grib_accessor_class_message.c | 4 +++ src/grib_accessor_class_message_copy.c | 4 +++ src/grib_accessor_class_missing.c | 2 ++ src/grib_accessor_class_nearest.c | 4 +++ src/grib_accessor_class_non_alpha.c | 4 +++ ...ib_accessor_class_number_of_coded_values.c | 4 +++ src/grib_accessor_class_number_of_points.c | 4 +++ ...accessor_class_number_of_points_gaussian.c | 4 +++ src/grib_accessor_class_number_of_values.c | 4 +++ ..._class_number_of_values_data_raw_packing.c | 4 +++ src/grib_accessor_class_octahedral_gaussian.c | 4 +++ src/grib_accessor_class_octet_number.c | 4 +++ src/grib_accessor_class_offset_file.c | 4 +++ src/grib_accessor_class_offset_values.c | 4 +++ src/grib_accessor_class_pack_bufr_values.c | 4 +++ src/grib_accessor_class_pad.c | 4 +++ src/grib_accessor_class_padding.c | 4 +++ src/grib_accessor_class_padto.c | 4 +++ src/grib_accessor_class_padtoeven.c | 4 +++ src/grib_accessor_class_padtomultiple.c | 4 +++ src/grib_accessor_class_position.c | 4 +++ src/grib_accessor_class_proj_string.c | 4 +++ src/grib_accessor_class_raw.c | 4 +++ src/grib_accessor_class_rdbtime_guess_date.c | 4 +++ ...rib_accessor_class_reference_value_error.c | 4 +++ src/grib_accessor_class_round.c | 4 +++ src/grib_accessor_class_scale.c | 4 +++ src/grib_accessor_class_scale_values.c | 4 +++ ...cessor_class_second_order_bits_per_value.c | 4 +++ src/grib_accessor_class_section.c | 4 +++ src/grib_accessor_class_section_length.c | 4 +++ src/grib_accessor_class_section_padding.c | 4 +++ src/grib_accessor_class_section_pointer.c | 4 +++ ...grib_accessor_class_select_step_template.c | 4 +++ src/grib_accessor_class_sexagesimal2decimal.c | 4 +++ src/grib_accessor_class_signed.c | 4 +++ src/grib_accessor_class_signed_bits.c | 4 +++ ...grib_accessor_class_simple_packing_error.c | 4 +++ src/grib_accessor_class_size.c | 4 +++ src/grib_accessor_class_smart_table.c | 4 +++ src/grib_accessor_class_smart_table_column.c | 4 +++ src/grib_accessor_class_spd.c | 4 +++ src/grib_accessor_class_spectral_truncation.c | 4 +++ src/grib_accessor_class_sprintf.c | 4 +++ src/grib_accessor_class_statistics.c | 4 +++ src/grib_accessor_class_statistics_spectral.c | 4 +++ src/grib_accessor_class_step_human_readable.c | 4 +++ src/grib_accessor_class_step_in_units.c | 4 +++ src/grib_accessor_class_sum.c | 4 +++ src/grib_accessor_class_suppressed.c | 4 +++ src/grib_accessor_class_time.c | 4 +++ src/grib_accessor_class_times.c | 4 +++ src/grib_accessor_class_to_double.c | 4 +++ src/grib_accessor_class_to_integer.c | 4 +++ src/grib_accessor_class_to_string.c | 4 +++ src/grib_accessor_class_transient.c | 4 +++ src/grib_accessor_class_transient_darray.c | 4 +++ src/grib_accessor_class_trim.c | 4 +++ src/grib_accessor_class_uint16.c | 4 +++ ...grib_accessor_class_uint16_little_endian.c | 4 +++ src/grib_accessor_class_uint32.c | 4 +++ ...grib_accessor_class_uint32_little_endian.c | 4 +++ src/grib_accessor_class_uint64.c | 4 +++ ...grib_accessor_class_uint64_little_endian.c | 4 +++ src/grib_accessor_class_uint8.c | 4 +++ ...ib_accessor_class_unexpanded_descriptors.c | 4 +++ src/grib_accessor_class_unpack_bufr_values.c | 4 +++ src/grib_accessor_class_unsigned.c | 4 +++ src/grib_accessor_class_unsigned_bits.c | 4 +++ src/grib_accessor_class_validity_date.c | 4 +++ src/grib_accessor_class_validity_time.c | 4 +++ src/grib_accessor_class_values.c | 4 +++ src/grib_accessor_class_variable.c | 4 +++ src/grib_accessor_class_vector.c | 4 +++ src/grib_accessor_class_when.c | 4 +++ src/grib_api.h | 2 ++ src/grib_api_internal.h | 5 ++- src/grib_value.c | 33 +++++++++++++++++++ 226 files changed, 933 insertions(+), 1 deletion(-) diff --git a/src/accessor.class b/src/accessor.class index 5996e2995..ff66f4760 100644 --- a/src/accessor.class +++ b/src/accessor.class @@ -33,7 +33,9 @@ static int nearest_smaller_value (grib_accessor*, double, double*); static grib_accessor* next(grib_accessor*, int); static int compare(grib_accessor*, grib_accessor*); static int unpack_double_element(grib_accessor*, size_t i, double* val); +static int unpack_float_element(grib_accessor*, size_t i, float* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); +static int unpack_float_element_set(grib_accessor*, const size_t* index_array, size_t len, float* val_array); static int unpack_double_subarray(grib_accessor*, double* val, size_t start, size_t len); static int clear(grib_accessor*); static grib_accessor* make_clone(grib_accessor*, grib_section*, int*); @@ -86,7 +88,9 @@ static grib_accessor_class _grib_accessor_class_NAME = { &next, /* next accessor */ &compare, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + &unpack_float_element, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + &unpack_float_element_set, /* unpack a given set of elements */ &unpack_double_subarray, /* unpack a subarray */ &clear, /* clear */ &make_clone, /* clone accessor */ diff --git a/src/eccodes.c b/src/eccodes.c index 8c696788e..425a9a035 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -337,6 +337,7 @@ int codes_get_double(const grib_handle* h, const char* key, double* value) { return grib_get_double(h, key, value); } + int codes_get_double_element(const grib_handle* h, const char* key, int i, double* value) { return grib_get_double_element(h, key, i, value); @@ -345,6 +346,15 @@ int codes_get_double_elements(const grib_handle* h, const char* key, const int* { return grib_get_double_elements(h, key, index_array, size, value); } +int codes_get_float_element(const grib_handle* h, const char* key, int i, float* value) +{ + return grib_get_float_element(h, key, i, value); +} +int codes_get_float_elements(const grib_handle* h, const char* key, const int* index_array, long size, float* value) +{ + return grib_get_float_elements(h, key, index_array, size, value); +} + int codes_get_string(const grib_handle* h, const char* key, char* mesg, size_t* length) { return grib_get_string(h, key, mesg, length); diff --git a/src/eccodes.h b/src/eccodes.h index d65c53cec..e90a4a398 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -784,6 +784,7 @@ int codes_get_double(const codes_handle* h, const char* key, double* value); * @return 0 if OK, integer value on error */ int codes_get_double_element(const codes_handle* h, const char* key, int i, double* value); +int codes_get_float_element(const codes_handle* h, const char* key, int i, float* value); /** * Get as double array the elements of the "key" array whose indexes are listed in the input array "index_array" @@ -796,6 +797,7 @@ int codes_get_double_element(const codes_handle* h, const char* key, int i, doub * @return 0 if OK, integer value on error */ int codes_get_double_elements(const codes_handle* h, const char* key, const int* index_array, long size, double* value); +int codes_get_float_elements(const codes_handle* h, const char* key, const int* index_array, long size, float* value); /** * Get a string value from a key, if several keys of the same name are present, the last one is returned diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index f0d38bcb8..8a33d6075 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1245,10 +1245,16 @@ int grib_get_double_internal(grib_handle* h, const char* name, double* val); int grib_get_double(const grib_handle* h, const char* name, double* val); int grib_get_double_element_internal(grib_handle* h, const char* name, int i, double* val); int grib_get_double_element(const grib_handle* h, const char* name, int i, double* val); +int grib_get_float_element(const grib_handle* h, const char* name, int i, float* val); + int grib_get_double_element_set_internal(grib_handle* h, const char* name, const size_t* index_array, size_t len, double* val_array); int grib_get_double_element_set(const grib_handle* h, const char* name, const size_t* index_array, size_t len, double* val_array); +int grib_get_float_element_set_internal(grib_handle* h, const char* name, const size_t* index_array, size_t len, float* val_array); +int grib_get_float_element_set(const grib_handle* h, const char* name, const size_t* index_array, size_t len, float* val_array); + int grib_points_get_values(grib_handle* h, grib_points* points, double* val); int grib_get_double_elements(const grib_handle* h, const char* name, const int* index_array, long len, double* val_array); +int grib_get_float_elements(const grib_handle* h, const char* name, const int* index_array, long len, float* val_array); int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length); int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length); int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length); diff --git a/src/grib_accessor_class_abstract_long_vector.c b/src/grib_accessor_class_abstract_long_vector.c index 8914f560c..b411df584 100644 --- a/src/grib_accessor_class_abstract_long_vector.c +++ b/src/grib_accessor_class_abstract_long_vector.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_abstract_long_vector = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_abstract_vector.c b/src/grib_accessor_class_abstract_vector.c index e6d771004..1e15ee282 100644 --- a/src/grib_accessor_class_abstract_vector.c +++ b/src/grib_accessor_class_abstract_vector.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_abstract_vector = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_apply_operators.c b/src/grib_accessor_class_apply_operators.c index ea3eb344b..437335d6d 100644 --- a/src/grib_accessor_class_apply_operators.c +++ b/src/grib_accessor_class_apply_operators.c @@ -144,7 +144,9 @@ static grib_accessor_class _grib_accessor_class_apply_operators = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -179,7 +181,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_array.c b/src/grib_accessor_class_array.c index e5df8b72d..321411730 100644 --- a/src/grib_accessor_class_array.c +++ b/src/grib_accessor_class_array.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_array = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_ascii.c b/src/grib_accessor_class_ascii.c index 465ddf8cf..e0d55747d 100644 --- a/src/grib_accessor_class_ascii.c +++ b/src/grib_accessor_class_ascii.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_ascii = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_assert.c b/src/grib_accessor_class_assert.c index d32716372..9a73a67ae 100644 --- a/src/grib_accessor_class_assert.c +++ b/src/grib_accessor_class_assert.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_assert = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bit.c b/src/grib_accessor_class_bit.c index 5976f4eaf..6372db7f6 100644 --- a/src/grib_accessor_class_bit.c +++ b/src/grib_accessor_class_bit.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_bit = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index b0dda5d52..198e33238 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -106,7 +106,9 @@ static grib_accessor_class _grib_accessor_class_bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -141,6 +143,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bits.c b/src/grib_accessor_class_bits.c index 9c0487c04..62a21bdb3 100644 --- a/src/grib_accessor_class_bits.c +++ b/src/grib_accessor_class_bits.c @@ -114,7 +114,9 @@ static grib_accessor_class _grib_accessor_class_bits = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -149,7 +151,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bits_per_value.c b/src/grib_accessor_class_bits_per_value.c index bb18d76f4..f6b69cda6 100644 --- a/src/grib_accessor_class_bits_per_value.c +++ b/src/grib_accessor_class_bits_per_value.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_bits_per_value = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_blob.c b/src/grib_accessor_class_blob.c index 606a1e7c1..dfd69beb1 100644 --- a/src/grib_accessor_class_blob.c +++ b/src/grib_accessor_class_blob.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_blob = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_box.c b/src/grib_accessor_class_box.c index abf19c0c2..4b31b9889 100644 --- a/src/grib_accessor_class_box.c +++ b/src/grib_accessor_class_box.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_box = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_budgdate.c b/src/grib_accessor_class_budgdate.c index fb0da1f19..24d354b7b 100644 --- a/src/grib_accessor_class_budgdate.c +++ b/src/grib_accessor_class_budgdate.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_budgdate = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 24a14bca4..34a2ceaaa 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -196,7 +196,9 @@ static grib_accessor_class _grib_accessor_class_bufr_data_array = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -229,7 +231,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_data_element.c b/src/grib_accessor_class_bufr_data_element.c index 22421d12c..ac6c5870a 100644 --- a/src/grib_accessor_class_bufr_data_element.c +++ b/src/grib_accessor_class_bufr_data_element.c @@ -128,7 +128,9 @@ static grib_accessor_class _grib_accessor_class_bufr_data_element = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ &make_clone, /* clone accessor */ @@ -157,7 +159,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; } diff --git a/src/grib_accessor_class_bufr_elements_table.c b/src/grib_accessor_class_bufr_elements_table.c index 7b8462e71..14fb769e2 100644 --- a/src/grib_accessor_class_bufr_elements_table.c +++ b/src/grib_accessor_class_bufr_elements_table.c @@ -127,7 +127,9 @@ static grib_accessor_class _grib_accessor_class_bufr_elements_table = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -165,7 +167,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_extract_area_subsets.c b/src/grib_accessor_class_bufr_extract_area_subsets.c index 344d1d911..5d2176daa 100644 --- a/src/grib_accessor_class_bufr_extract_area_subsets.c +++ b/src/grib_accessor_class_bufr_extract_area_subsets.c @@ -105,7 +105,9 @@ static grib_accessor_class _grib_accessor_class_bufr_extract_area_subsets = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -146,7 +148,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index c3988781a..8a2aee911 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_bufr_extract_datetime_subsets = 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_extract_subsets.c b/src/grib_accessor_class_bufr_extract_subsets.c index b3b0b71ed..d618e9f4d 100644 --- a/src/grib_accessor_class_bufr_extract_subsets.c +++ b/src/grib_accessor_class_bufr_extract_subsets.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_bufr_extract_subsets = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_group.c b/src/grib_accessor_class_bufr_group.c index 3d5c30e3a..350ce034b 100644 --- a/src/grib_accessor_class_bufr_group.c +++ b/src/grib_accessor_class_bufr_group.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_bufr_group = { &next, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -130,7 +132,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_simple_thinning.c b/src/grib_accessor_class_bufr_simple_thinning.c index 280151846..9d3544122 100644 --- a/src/grib_accessor_class_bufr_simple_thinning.c +++ b/src/grib_accessor_class_bufr_simple_thinning.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_bufr_simple_thinning = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufr_string_values.c b/src/grib_accessor_class_bufr_string_values.c index af6a76125..ba78d3c77 100644 --- a/src/grib_accessor_class_bufr_string_values.c +++ b/src/grib_accessor_class_bufr_string_values.c @@ -105,7 +105,9 @@ static grib_accessor_class _grib_accessor_class_bufr_string_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.c b/src/grib_accessor_class_bufrdc_expanded_descriptors.c index 1272800c3..77115dfe1 100644 --- a/src/grib_accessor_class_bufrdc_expanded_descriptors.c +++ b/src/grib_accessor_class_bufrdc_expanded_descriptors.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_bufrdc_expanded_descriptors = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_bytes.c b/src/grib_accessor_class_bytes.c index 0b6d2f0b3..8b6bbe256 100644 --- a/src/grib_accessor_class_bytes.c +++ b/src/grib_accessor_class_bytes.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_bytes = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_change_alternative_row_scanning.c b/src/grib_accessor_class_change_alternative_row_scanning.c index 24bbec32e..d5567a931 100644 --- a/src/grib_accessor_class_change_alternative_row_scanning.c +++ b/src/grib_accessor_class_change_alternative_row_scanning.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_change_alternative_row_scanning 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_change_scanning_direction.c b/src/grib_accessor_class_change_scanning_direction.c index d57d4d402..dd480fb77 100644 --- a/src/grib_accessor_class_change_scanning_direction.c +++ b/src/grib_accessor_class_change_scanning_direction.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_change_scanning_direction = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -143,7 +145,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_check_internal_version.c b/src/grib_accessor_class_check_internal_version.c index cdde8f1f2..6e7e1d9ba 100644 --- a/src/grib_accessor_class_check_internal_version.c +++ b/src/grib_accessor_class_check_internal_version.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_check_internal_version = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_closest_date.c b/src/grib_accessor_class_closest_date.c index 421957f73..b735e3aed 100644 --- a/src/grib_accessor_class_closest_date.c +++ b/src/grib_accessor_class_closest_date.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_closest_date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -149,7 +151,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_codeflag.c b/src/grib_accessor_class_codeflag.c index 0a60fed58..ac2d8a62a 100644 --- a/src/grib_accessor_class_codeflag.c +++ b/src/grib_accessor_class_codeflag.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_codeflag = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_codetable.c b/src/grib_accessor_class_codetable.c index bd71b0b19..8b525e246 100644 --- a/src/grib_accessor_class_codetable.c +++ b/src/grib_accessor_class_codetable.c @@ -139,7 +139,9 @@ static grib_accessor_class _grib_accessor_class_codetable = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -175,7 +177,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_codetable_title.c b/src/grib_accessor_class_codetable_title.c index 8418d55f5..897a7b2b2 100644 --- a/src/grib_accessor_class_codetable_title.c +++ b/src/grib_accessor_class_codetable_title.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_codetable_title = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_codetable_units.c b/src/grib_accessor_class_codetable_units.c index 9ba3ac9ed..9f1d40e0a 100644 --- a/src/grib_accessor_class_codetable_units.c +++ b/src/grib_accessor_class_codetable_units.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_codetable_units = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_concept.c b/src/grib_accessor_class_concept.c index f1d7724c3..4e856c64d 100644 --- a/src/grib_accessor_class_concept.c +++ b/src/grib_accessor_class_concept.c @@ -104,7 +104,9 @@ static grib_accessor_class _grib_accessor_class_concept = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_constant.c b/src/grib_accessor_class_constant.c index 738039527..6c5bbda84 100644 --- a/src/grib_accessor_class_constant.c +++ b/src/grib_accessor_class_constant.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_constant = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_count_file.c b/src/grib_accessor_class_count_file.c index f0146f77a..ad40e2cbe 100644 --- a/src/grib_accessor_class_count_file.c +++ b/src/grib_accessor_class_count_file.c @@ -88,7 +88,9 @@ static grib_accessor_class _grib_accessor_class_count_file = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -130,7 +132,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_count_missing.c b/src/grib_accessor_class_count_missing.c index da6d1fc2e..b7c2b66e3 100644 --- a/src/grib_accessor_class_count_missing.c +++ b/src/grib_accessor_class_count_missing.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_count_missing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_count_total.c b/src/grib_accessor_class_count_total.c index ae6c3309c..cf5ed7972 100644 --- a/src/grib_accessor_class_count_total.c +++ b/src/grib_accessor_class_count_total.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_count_total = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_2order_packing.c b/src/grib_accessor_class_data_2order_packing.c index c8a3d6ef1..5d93ef8f8 100644 --- a/src/grib_accessor_class_data_2order_packing.c +++ b/src/grib_accessor_class_data_2order_packing.c @@ -142,7 +142,9 @@ static grib_accessor_class _grib_accessor_class_data_2order_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -182,7 +184,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index f0eaed5e3..148cf7207 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -107,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -143,6 +145,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.c b/src/grib_accessor_class_data_apply_boustrophedonic.c index 5d0cfbc2c..470ef4cc2 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,6 +142,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c index 4f9035ef2..a1aa5c812 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c +++ b/src/grib_accessor_class_data_apply_boustrophedonic_bitmap.c @@ -108,7 +108,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic_bitma 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -145,6 +147,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.c b/src/grib_accessor_class_data_apply_gdsnotpresent.c index b2cbe97d2..1e7c38e57 100644 --- a/src/grib_accessor_class_data_apply_gdsnotpresent.c +++ b/src/grib_accessor_class_data_apply_gdsnotpresent.c @@ -112,7 +112,9 @@ static grib_accessor_class _grib_accessor_class_data_apply_gdsnotpresent = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -150,7 +152,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 85088f764..26c6aa4e3 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -121,7 +121,9 @@ static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -159,6 +161,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index 8bc3b2cf5..b538ea497 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -128,7 +128,9 @@ static grib_accessor_class _grib_accessor_class_data_complex_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -168,7 +170,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_dummy_field.c b/src/grib_accessor_class_data_dummy_field.c index c90d5df9d..0ca1b5508 100644 --- a/src/grib_accessor_class_data_dummy_field.c +++ b/src/grib_accessor_class_data_dummy_field.c @@ -117,7 +117,9 @@ static grib_accessor_class _grib_accessor_class_data_dummy_field = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -157,7 +159,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1complex_packing.c b/src/grib_accessor_class_data_g1complex_packing.c index 2e8a0593e..e7a57cd85 100644 --- a/src/grib_accessor_class_data_g1complex_packing.c +++ b/src/grib_accessor_class_data_g1complex_packing.c @@ -124,7 +124,9 @@ static grib_accessor_class _grib_accessor_class_data_g1complex_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -166,7 +168,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c index 452079b15..23220df88 100644 --- a/src/grib_accessor_class_data_g1second_order_constant_width_packing.c +++ b/src/grib_accessor_class_data_g1second_order_constant_width_packing.c @@ -142,7 +142,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_constant_wid 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -181,6 +183,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c index 651dd92cc..df99452a0 100644 --- a/src/grib_accessor_class_data_g1second_order_general_extended_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_extended_packing.c @@ -162,7 +162,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_exte 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -201,6 +203,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1second_order_general_packing.c b/src/grib_accessor_class_data_g1second_order_general_packing.c index d11d92c19..fe16c187d 100644 --- a/src/grib_accessor_class_data_g1second_order_general_packing.c +++ b/src/grib_accessor_class_data_g1second_order_general_packing.c @@ -139,7 +139,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_pack 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -179,7 +181,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c index 461049f7e..4eb575515 100644 --- a/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c +++ b/src/grib_accessor_class_data_g1second_order_row_by_row_packing.c @@ -139,7 +139,9 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_row_by_row_p 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -179,7 +181,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1secondary_bitmap.c b/src/grib_accessor_class_data_g1secondary_bitmap.c index aa888635d..aa34acbd7 100644 --- a/src/grib_accessor_class_data_g1secondary_bitmap.c +++ b/src/grib_accessor_class_data_g1secondary_bitmap.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_data_g1secondary_bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1shsimple_packing.c b/src/grib_accessor_class_data_g1shsimple_packing.c index b0924da79..c519f3deb 100644 --- a/src/grib_accessor_class_data_g1shsimple_packing.c +++ b/src/grib_accessor_class_data_g1shsimple_packing.c @@ -88,7 +88,9 @@ static grib_accessor_class _grib_accessor_class_data_g1shsimple_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g1simple_packing.c b/src/grib_accessor_class_data_g1simple_packing.c index 0461d6e2b..cf8e744aa 100644 --- a/src/grib_accessor_class_data_g1simple_packing.c +++ b/src/grib_accessor_class_data_g1simple_packing.c @@ -112,7 +112,9 @@ static grib_accessor_class _grib_accessor_class_data_g1simple_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -153,7 +155,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g22order_packing.c b/src/grib_accessor_class_data_g22order_packing.c index 21366307b..d792afaca 100644 --- a/src/grib_accessor_class_data_g22order_packing.c +++ b/src/grib_accessor_class_data_g22order_packing.c @@ -137,7 +137,9 @@ static grib_accessor_class _grib_accessor_class_data_g22order_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -176,6 +178,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 37524b7a0..1e2335c0f 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -138,7 +138,9 @@ static grib_accessor_class _grib_accessor_class_data_g2bifourier_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -178,7 +180,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g2complex_packing.c b/src/grib_accessor_class_data_g2complex_packing.c index 30386fdf6..363c4d88a 100644 --- a/src/grib_accessor_class_data_g2complex_packing.c +++ b/src/grib_accessor_class_data_g2complex_packing.c @@ -117,7 +117,9 @@ static grib_accessor_class _grib_accessor_class_data_g2complex_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -158,7 +160,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g2secondary_bitmap.c b/src/grib_accessor_class_data_g2secondary_bitmap.c index 7e98a0bc2..7756962f6 100644 --- a/src/grib_accessor_class_data_g2secondary_bitmap.c +++ b/src/grib_accessor_class_data_g2secondary_bitmap.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_data_g2secondary_bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g2shsimple_packing.c b/src/grib_accessor_class_data_g2shsimple_packing.c index f166060b3..8f5d6d981 100644 --- a/src/grib_accessor_class_data_g2shsimple_packing.c +++ b/src/grib_accessor_class_data_g2shsimple_packing.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_data_g2shsimple_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g2simple_packing.c b/src/grib_accessor_class_data_g2simple_packing.c index 5a759ac5a..0adaf67bb 100644 --- a/src/grib_accessor_class_data_g2simple_packing.c +++ b/src/grib_accessor_class_data_g2simple_packing.c @@ -106,7 +106,9 @@ static grib_accessor_class _grib_accessor_class_data_g2simple_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -146,7 +148,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c index dd391b8a0..55549fdd9 100644 --- a/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c +++ b/src/grib_accessor_class_data_g2simple_packing_with_preprocessing.c @@ -121,7 +121,9 @@ static grib_accessor_class _grib_accessor_class_data_g2simple_packing_with_prepr 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -161,7 +163,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_jpeg2000_packing.c b/src/grib_accessor_class_data_jpeg2000_packing.c index 008318017..9b813dd6d 100644 --- a/src/grib_accessor_class_data_jpeg2000_packing.c +++ b/src/grib_accessor_class_data_jpeg2000_packing.c @@ -127,7 +127,9 @@ static grib_accessor_class _grib_accessor_class_data_jpeg2000_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -166,6 +168,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_png_packing.c b/src/grib_accessor_class_data_png_packing.c index 95b079853..fef46a58f 100644 --- a/src/grib_accessor_class_data_png_packing.c +++ b/src/grib_accessor_class_data_png_packing.c @@ -120,7 +120,9 @@ static grib_accessor_class _grib_accessor_class_data_png_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -159,6 +161,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_raw_packing.c b/src/grib_accessor_class_data_raw_packing.c index 6c9470e86..c89adaa98 100644 --- a/src/grib_accessor_class_data_raw_packing.c +++ b/src/grib_accessor_class_data_raw_packing.c @@ -107,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_data_raw_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -146,6 +148,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_secondary_bitmap.c b/src/grib_accessor_class_data_secondary_bitmap.c index f9774e60b..e914ecd4a 100644 --- a/src/grib_accessor_class_data_secondary_bitmap.c +++ b/src/grib_accessor_class_data_secondary_bitmap.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_data_secondary_bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_sh_packed.c b/src/grib_accessor_class_data_sh_packed.c index 2dc809432..0d78b879a 100644 --- a/src/grib_accessor_class_data_sh_packed.c +++ b/src/grib_accessor_class_data_sh_packed.c @@ -125,7 +125,9 @@ static grib_accessor_class _grib_accessor_class_data_sh_packed = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -166,7 +168,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_sh_unpacked.c b/src/grib_accessor_class_data_sh_unpacked.c index 4f36be384..baacec961 100644 --- a/src/grib_accessor_class_data_sh_unpacked.c +++ b/src/grib_accessor_class_data_sh_unpacked.c @@ -125,7 +125,9 @@ static grib_accessor_class _grib_accessor_class_data_sh_unpacked = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -166,7 +168,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_shsimple_packing.c b/src/grib_accessor_class_data_shsimple_packing.c index 9337cb4e7..643e2e035 100644 --- a/src/grib_accessor_class_data_shsimple_packing.c +++ b/src/grib_accessor_class_data_shsimple_packing.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_data_shsimple_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_data_simple_packing.c b/src/grib_accessor_class_data_simple_packing.c index 06a039ec4..31ddd9df2 100644 --- a/src/grib_accessor_class_data_simple_packing.c +++ b/src/grib_accessor_class_data_simple_packing.c @@ -127,7 +127,9 @@ static grib_accessor_class _grib_accessor_class_data_simple_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ &unpack_double_subarray, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -165,6 +167,8 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; + c->unpack_float_element = (*(c->super))->unpack_float_element; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; } diff --git a/src/grib_accessor_class_decimal_precision.c b/src/grib_accessor_class_decimal_precision.c index 5f2812bd9..0d5bbd6c7 100644 --- a/src/grib_accessor_class_decimal_precision.c +++ b/src/grib_accessor_class_decimal_precision.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_decimal_precision = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_dictionary.c b/src/grib_accessor_class_dictionary.c index 7eea2f9ec..f239ccdfb 100644 --- a/src/grib_accessor_class_dictionary.c +++ b/src/grib_accessor_class_dictionary.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_dictionary = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_dirty.c b/src/grib_accessor_class_dirty.c index 972935bbf..b94270be0 100644 --- a/src/grib_accessor_class_dirty.c +++ b/src/grib_accessor_class_dirty.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_dirty = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_divdouble.c b/src/grib_accessor_class_divdouble.c index 844747fba..dda267300 100644 --- a/src/grib_accessor_class_divdouble.c +++ b/src/grib_accessor_class_divdouble.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_divdouble = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_double.c b/src/grib_accessor_class_double.c index d22698f03..62a4aea5b 100644 --- a/src/grib_accessor_class_double.c +++ b/src/grib_accessor_class_double.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_double = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_element.c b/src/grib_accessor_class_element.c index ff44a3d8d..4b3c15973 100644 --- a/src/grib_accessor_class_element.c +++ b/src/grib_accessor_class_element.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_element = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_evaluate.c b/src/grib_accessor_class_evaluate.c index 87a38d536..1099e4099 100644 --- a/src/grib_accessor_class_evaluate.c +++ b/src/grib_accessor_class_evaluate.c @@ -88,7 +88,9 @@ static grib_accessor_class _grib_accessor_class_evaluate = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_expanded_descriptors.c b/src/grib_accessor_class_expanded_descriptors.c index e25f1e16a..66c56c9ae 100644 --- a/src/grib_accessor_class_expanded_descriptors.c +++ b/src/grib_accessor_class_expanded_descriptors.c @@ -119,7 +119,9 @@ static grib_accessor_class _grib_accessor_class_expanded_descriptors = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -156,7 +158,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_forward.c b/src/grib_accessor_class_forward.c index 39ee7caac..da816334a 100644 --- a/src/grib_accessor_class_forward.c +++ b/src/grib_accessor_class_forward.c @@ -83,7 +83,9 @@ static grib_accessor_class _grib_accessor_class_forward = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -125,7 +127,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_from_scale_factor_scaled_value.c b/src/grib_accessor_class_from_scale_factor_scaled_value.c index aec51c29e..ef4b30cf2 100644 --- a/src/grib_accessor_class_from_scale_factor_scaled_value.c +++ b/src/grib_accessor_class_from_scale_factor_scaled_value.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_from_scale_factor_scaled_value = 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1_half_byte_codeflag.c b/src/grib_accessor_class_g1_half_byte_codeflag.c index 22e606eb9..6d819c2b7 100644 --- a/src/grib_accessor_class_g1_half_byte_codeflag.c +++ b/src/grib_accessor_class_g1_half_byte_codeflag.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1_message_length.c b/src/grib_accessor_class_g1_message_length.c index be0398420..9eb10664e 100644 --- a/src/grib_accessor_class_g1_message_length.c +++ b/src/grib_accessor_class_g1_message_length.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_g1_message_length = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1_section4_length.c b/src/grib_accessor_class_g1_section4_length.c index b76724a73..6e114daaf 100644 --- a/src/grib_accessor_class_g1_section4_length.c +++ b/src/grib_accessor_class_g1_section4_length.c @@ -91,7 +91,9 @@ static grib_accessor_class _grib_accessor_class_g1_section4_length = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1area.c b/src/grib_accessor_class_g1area.c index 5af99c7dd..616797efd 100644 --- a/src/grib_accessor_class_g1area.c +++ b/src/grib_accessor_class_g1area.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_g1area = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1bitmap.c b/src/grib_accessor_class_g1bitmap.c index 862634de7..bee7e21bc 100644 --- a/src/grib_accessor_class_g1bitmap.c +++ b/src/grib_accessor_class_g1bitmap.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_g1bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1date.c b/src/grib_accessor_class_g1date.c index 4b2cec614..4113e3fa1 100644 --- a/src/grib_accessor_class_g1date.c +++ b/src/grib_accessor_class_g1date.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_g1date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1day_of_the_year_date.c b/src/grib_accessor_class_g1day_of_the_year_date.c index 6551c5247..c14fa427a 100644 --- a/src/grib_accessor_class_g1day_of_the_year_date.c +++ b/src/grib_accessor_class_g1day_of_the_year_date.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_g1day_of_the_year_date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1end_of_interval_monthly.c b/src/grib_accessor_class_g1end_of_interval_monthly.c index a8ed48a10..b47b659b4 100644 --- a/src/grib_accessor_class_g1end_of_interval_monthly.c +++ b/src/grib_accessor_class_g1end_of_interval_monthly.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_g1end_of_interval_monthly = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1fcperiod.c b/src/grib_accessor_class_g1fcperiod.c index a905ecef7..e0ad74979 100644 --- a/src/grib_accessor_class_g1fcperiod.c +++ b/src/grib_accessor_class_g1fcperiod.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_g1fcperiod = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1forecastmonth.c b/src/grib_accessor_class_g1forecastmonth.c index 2a94e10d0..62bb3a7f2 100644 --- a/src/grib_accessor_class_g1forecastmonth.c +++ b/src/grib_accessor_class_g1forecastmonth.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_g1forecastmonth = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1monthlydate.c b/src/grib_accessor_class_g1monthlydate.c index 10daccba5..a3b47807e 100644 --- a/src/grib_accessor_class_g1monthlydate.c +++ b/src/grib_accessor_class_g1monthlydate.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_g1monthlydate = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c index bd19466aa..c643f2a55 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_complex.c @@ -104,7 +104,9 @@ static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_comp 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -146,7 +148,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c index 13d2b39c8..9b8a3d772 100644 --- a/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c +++ b/src/grib_accessor_class_g1number_of_coded_values_sh_simple.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_g1number_of_coded_values_sh_simp 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1step_range.c b/src/grib_accessor_class_g1step_range.c index df32776ab..acf30c9f2 100644 --- a/src/grib_accessor_class_g1step_range.c +++ b/src/grib_accessor_class_g1step_range.c @@ -118,7 +118,9 @@ static grib_accessor_class _grib_accessor_class_g1step_range = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -153,7 +155,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g1verificationdate.c b/src/grib_accessor_class_g1verificationdate.c index 5ceea3b9e..651f9d322 100644 --- a/src/grib_accessor_class_g1verificationdate.c +++ b/src/grib_accessor_class_g1verificationdate.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_g1verificationdate = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2_aerosol.c b/src/grib_accessor_class_g2_aerosol.c index 5173de5f0..ef17cfbc2 100644 --- a/src/grib_accessor_class_g2_aerosol.c +++ b/src/grib_accessor_class_g2_aerosol.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_g2_aerosol = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2_chemical.c b/src/grib_accessor_class_g2_chemical.c index 0501a6007..94cb80aeb 100644 --- a/src/grib_accessor_class_g2_chemical.c +++ b/src/grib_accessor_class_g2_chemical.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_g2_chemical = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2_eps.c b/src/grib_accessor_class_g2_eps.c index 45742d77e..c8918eeff 100644 --- a/src/grib_accessor_class_g2_eps.c +++ b/src/grib_accessor_class_g2_eps.c @@ -105,7 +105,9 @@ static grib_accessor_class _grib_accessor_class_g2_eps = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -145,7 +147,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2_mars_labeling.c b/src/grib_accessor_class_g2_mars_labeling.c index 9276b4bfd..b11cbb30a 100644 --- a/src/grib_accessor_class_g2_mars_labeling.c +++ b/src/grib_accessor_class_g2_mars_labeling.c @@ -116,7 +116,9 @@ static grib_accessor_class _grib_accessor_class_g2_mars_labeling = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -153,7 +155,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2bitmap.c b/src/grib_accessor_class_g2bitmap.c index 7f45c9b32..c17da753b 100644 --- a/src/grib_accessor_class_g2bitmap.c +++ b/src/grib_accessor_class_g2bitmap.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_g2bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2bitmap_present.c b/src/grib_accessor_class_g2bitmap_present.c index 90d19cb0c..93201529f 100644 --- a/src/grib_accessor_class_g2bitmap_present.c +++ b/src/grib_accessor_class_g2bitmap_present.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_g2bitmap_present = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2date.c b/src/grib_accessor_class_g2date.c index a3945bf06..d3523dfbe 100644 --- a/src/grib_accessor_class_g2date.c +++ b/src/grib_accessor_class_g2date.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_g2date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2end_step.c b/src/grib_accessor_class_g2end_step.c index 735841d30..a450bec15 100644 --- a/src/grib_accessor_class_g2end_step.c +++ b/src/grib_accessor_class_g2end_step.c @@ -127,7 +127,9 @@ static grib_accessor_class _grib_accessor_class_g2end_step = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -167,7 +169,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2grid.c b/src/grib_accessor_class_g2grid.c index 614d9295b..fba5d7ccc 100644 --- a/src/grib_accessor_class_g2grid.c +++ b/src/grib_accessor_class_g2grid.c @@ -108,7 +108,9 @@ static grib_accessor_class _grib_accessor_class_g2grid = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -148,7 +150,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2latlon.c b/src/grib_accessor_class_g2latlon.c index 0a507f23b..ff9adf7db 100644 --- a/src/grib_accessor_class_g2latlon.c +++ b/src/grib_accessor_class_g2latlon.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_g2latlon = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2level.c b/src/grib_accessor_class_g2level.c index 3171c0696..aa96c4f35 100644 --- a/src/grib_accessor_class_g2level.c +++ b/src/grib_accessor_class_g2level.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_g2level = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2lon.c b/src/grib_accessor_class_g2lon.c index ad065f751..03baff9bf 100644 --- a/src/grib_accessor_class_g2lon.c +++ b/src/grib_accessor_class_g2lon.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_g2lon = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_g2step_range.c b/src/grib_accessor_class_g2step_range.c index 8159ad797..d99950c79 100644 --- a/src/grib_accessor_class_g2step_range.c +++ b/src/grib_accessor_class_g2step_range.c @@ -101,7 +101,9 @@ static grib_accessor_class _grib_accessor_class_g2step_range = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_gaussian_grid_name.c b/src/grib_accessor_class_gaussian_grid_name.c index 38d728596..2906cf77a 100644 --- a/src/grib_accessor_class_gaussian_grid_name.c +++ b/src/grib_accessor_class_gaussian_grid_name.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_gaussian_grid_name = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_gds_is_present.c b/src/grib_accessor_class_gds_is_present.c index c48a9ba52..bb5e2910c 100644 --- a/src/grib_accessor_class_gds_is_present.c +++ b/src/grib_accessor_class_gds_is_present.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_gds_is_present = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -139,7 +141,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_gds_not_present_bitmap.c b/src/grib_accessor_class_gds_not_present_bitmap.c index b337730b8..40700c089 100644 --- a/src/grib_accessor_class_gds_not_present_bitmap.c +++ b/src/grib_accessor_class_gds_not_present_bitmap.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_gds_not_present_bitmap = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -143,7 +145,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index 29e0f952b..cc2f39662 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -128,7 +128,9 @@ static grib_accessor_class _grib_accessor_class_gen = { &next, /* next accessor */ &compare, /* compare vs. another accessor */ &unpack_double_element, /* unpack only ith value */ + 0, /* unpack only ith value */ &unpack_double_element_set, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ &unpack_double_subarray, /* unpack a subarray */ &clear, /* clear */ &make_clone, /* clone accessor */ diff --git a/src/grib_accessor_class_getenv.c b/src/grib_accessor_class_getenv.c index 2eeb4c010..bf2db877c 100644 --- a/src/grib_accessor_class_getenv.c +++ b/src/grib_accessor_class_getenv.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_getenv = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_global_gaussian.c b/src/grib_accessor_class_global_gaussian.c index f91fc05ac..579dc5cc5 100644 --- a/src/grib_accessor_class_global_gaussian.c +++ b/src/grib_accessor_class_global_gaussian.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_global_gaussian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -150,7 +152,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_group.c b/src/grib_accessor_class_group.c index 769d17722..6e7f4dd85 100644 --- a/src/grib_accessor_class_group.c +++ b/src/grib_accessor_class_group.c @@ -107,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_group = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_gts_header.c b/src/grib_accessor_class_gts_header.c index 190fab23c..d47ef0328 100644 --- a/src/grib_accessor_class_gts_header.c +++ b/src/grib_accessor_class_gts_header.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_gts_header = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_hash_array.c b/src/grib_accessor_class_hash_array.c index 7d194fd81..09ec86169 100644 --- a/src/grib_accessor_class_hash_array.c +++ b/src/grib_accessor_class_hash_array.c @@ -108,7 +108,9 @@ static grib_accessor_class _grib_accessor_class_hash_array = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_headers_only.c b/src/grib_accessor_class_headers_only.c index 2da5ce7be..5626d582d 100644 --- a/src/grib_accessor_class_headers_only.c +++ b/src/grib_accessor_class_headers_only.c @@ -84,7 +84,9 @@ static grib_accessor_class _grib_accessor_class_headers_only = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -125,7 +127,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_ibmfloat.c b/src/grib_accessor_class_ibmfloat.c index cbd5f8671..70a523347 100644 --- a/src/grib_accessor_class_ibmfloat.c +++ b/src/grib_accessor_class_ibmfloat.c @@ -105,7 +105,9 @@ static grib_accessor_class _grib_accessor_class_ibmfloat = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_ieeefloat.c b/src/grib_accessor_class_ieeefloat.c index 89634f0f5..599145a8d 100644 --- a/src/grib_accessor_class_ieeefloat.c +++ b/src/grib_accessor_class_ieeefloat.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_ieeefloat = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_ifs_param.c b/src/grib_accessor_class_ifs_param.c index 0758b3632..6e00e5913 100644 --- a/src/grib_accessor_class_ifs_param.c +++ b/src/grib_accessor_class_ifs_param.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_ifs_param = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int16.c b/src/grib_accessor_class_int16.c index 67360bebc..0e46a4a88 100644 --- a/src/grib_accessor_class_int16.c +++ b/src/grib_accessor_class_int16.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int16 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int16_little_endian.c b/src/grib_accessor_class_int16_little_endian.c index 3a2ad30c8..34375162e 100644 --- a/src/grib_accessor_class_int16_little_endian.c +++ b/src/grib_accessor_class_int16_little_endian.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int16_little_endian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int32.c b/src/grib_accessor_class_int32.c index 47de07a65..d45dd6115 100644 --- a/src/grib_accessor_class_int32.c +++ b/src/grib_accessor_class_int32.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int32 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int32_little_endian.c b/src/grib_accessor_class_int32_little_endian.c index 8af8708e4..a91e18253 100644 --- a/src/grib_accessor_class_int32_little_endian.c +++ b/src/grib_accessor_class_int32_little_endian.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int32_little_endian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int64.c b/src/grib_accessor_class_int64.c index 4f930ed91..5bfdba96e 100644 --- a/src/grib_accessor_class_int64.c +++ b/src/grib_accessor_class_int64.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int64 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int64_little_endian.c b/src/grib_accessor_class_int64_little_endian.c index bf344500d..acba5952d 100644 --- a/src/grib_accessor_class_int64_little_endian.c +++ b/src/grib_accessor_class_int64_little_endian.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int64_little_endian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_int8.c b/src/grib_accessor_class_int8.c index fae78881b..25f1e9e4e 100644 --- a/src/grib_accessor_class_int8.c +++ b/src/grib_accessor_class_int8.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_int8 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_iterator.c b/src/grib_accessor_class_iterator.c index 559a1585f..8eab065b9 100644 --- a/src/grib_accessor_class_iterator.c +++ b/src/grib_accessor_class_iterator.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_iterator = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_julian_date.c b/src/grib_accessor_class_julian_date.c index cfa9825bc..2ce59d6be 100644 --- a/src/grib_accessor_class_julian_date.c +++ b/src/grib_accessor_class_julian_date.c @@ -115,7 +115,9 @@ static grib_accessor_class _grib_accessor_class_julian_date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -150,7 +152,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_julian_day.c b/src/grib_accessor_class_julian_day.c index 6014d996f..332fc3c8a 100644 --- a/src/grib_accessor_class_julian_day.c +++ b/src/grib_accessor_class_julian_day.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_julian_day = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_ksec1expver.c b/src/grib_accessor_class_ksec1expver.c index 9aefb91a9..41c61980e 100644 --- a/src/grib_accessor_class_ksec1expver.c +++ b/src/grib_accessor_class_ksec1expver.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_ksec1expver = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_label.c b/src/grib_accessor_class_label.c index d71d7b727..9eecba906 100644 --- a/src/grib_accessor_class_label.c +++ b/src/grib_accessor_class_label.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_label = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_laplacian.c b/src/grib_accessor_class_laplacian.c index 68114d14b..293f216f4 100644 --- a/src/grib_accessor_class_laplacian.c +++ b/src/grib_accessor_class_laplacian.c @@ -104,7 +104,9 @@ static grib_accessor_class _grib_accessor_class_laplacian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -143,7 +145,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_latitudes.c b/src/grib_accessor_class_latitudes.c index b2fb2ec5c..829d0210c 100644 --- a/src/grib_accessor_class_latitudes.c +++ b/src/grib_accessor_class_latitudes.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_latitudes = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_latlon_increment.c b/src/grib_accessor_class_latlon_increment.c index a8fdb0010..4c5953800 100644 --- a/src/grib_accessor_class_latlon_increment.c +++ b/src/grib_accessor_class_latlon_increment.c @@ -105,7 +105,9 @@ static grib_accessor_class _grib_accessor_class_latlon_increment = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -145,7 +147,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_latlonvalues.c b/src/grib_accessor_class_latlonvalues.c index 01aed3bcd..1d3a67ae0 100644 --- a/src/grib_accessor_class_latlonvalues.c +++ b/src/grib_accessor_class_latlonvalues.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_latlonvalues = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_library_version.c b/src/grib_accessor_class_library_version.c index 7627f69d9..c6c0dc791 100644 --- a/src/grib_accessor_class_library_version.c +++ b/src/grib_accessor_class_library_version.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_library_version = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -125,7 +127,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_local_definition.c b/src/grib_accessor_class_local_definition.c index 926c59914..972b707e0 100644 --- a/src/grib_accessor_class_local_definition.c +++ b/src/grib_accessor_class_local_definition.c @@ -112,7 +112,9 @@ static grib_accessor_class _grib_accessor_class_local_definition = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -152,7 +154,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_long.c b/src/grib_accessor_class_long.c index 3433dbb24..6f5babcde 100644 --- a/src/grib_accessor_class_long.c +++ b/src/grib_accessor_class_long.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_long = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_long_vector.c b/src/grib_accessor_class_long_vector.c index 51fdd818b..b5389b512 100644 --- a/src/grib_accessor_class_long_vector.c +++ b/src/grib_accessor_class_long_vector.c @@ -101,7 +101,9 @@ static grib_accessor_class _grib_accessor_class_long_vector = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_longitudes.c b/src/grib_accessor_class_longitudes.c index e8d423fbb..58d5c4b4b 100644 --- a/src/grib_accessor_class_longitudes.c +++ b/src/grib_accessor_class_longitudes.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_longitudes = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -143,7 +145,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_lookup.c b/src/grib_accessor_class_lookup.c index 3ae87a317..e8ce7af09 100644 --- a/src/grib_accessor_class_lookup.c +++ b/src/grib_accessor_class_lookup.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_lookup = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_mars_param.c b/src/grib_accessor_class_mars_param.c index 82223561e..d5c6da1fd 100644 --- a/src/grib_accessor_class_mars_param.c +++ b/src/grib_accessor_class_mars_param.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_mars_param = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_mars_step.c b/src/grib_accessor_class_mars_step.c index 515deef1c..bdf0715c9 100644 --- a/src/grib_accessor_class_mars_step.c +++ b/src/grib_accessor_class_mars_step.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_mars_step = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_md5.c b/src/grib_accessor_class_md5.c index 9ce199ff8..e5ea8177e 100644 --- a/src/grib_accessor_class_md5.c +++ b/src/grib_accessor_class_md5.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_md5 = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_message.c b/src/grib_accessor_class_message.c index c4c35dd41..11d430127 100644 --- a/src/grib_accessor_class_message.c +++ b/src/grib_accessor_class_message.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_message = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_message_copy.c b/src/grib_accessor_class_message_copy.c index 8b55e3d71..ed6d43c9b 100644 --- a/src/grib_accessor_class_message_copy.c +++ b/src/grib_accessor_class_message_copy.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_message_copy = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_missing.c b/src/grib_accessor_class_missing.c index c88b7b54e..d6eb6af52 100644 --- a/src/grib_accessor_class_missing.c +++ b/src/grib_accessor_class_missing.c @@ -111,7 +111,9 @@ static grib_accessor_class _grib_accessor_class_missing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ diff --git a/src/grib_accessor_class_nearest.c b/src/grib_accessor_class_nearest.c index 9c43b081e..329c2b8b5 100644 --- a/src/grib_accessor_class_nearest.c +++ b/src/grib_accessor_class_nearest.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_nearest = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_non_alpha.c b/src/grib_accessor_class_non_alpha.c index c82c49fb9..6eb316d6b 100644 --- a/src/grib_accessor_class_non_alpha.c +++ b/src/grib_accessor_class_non_alpha.c @@ -104,7 +104,9 @@ static grib_accessor_class _grib_accessor_class_non_alpha = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_number_of_coded_values.c b/src/grib_accessor_class_number_of_coded_values.c index 667705ba5..df2c48f5a 100644 --- a/src/grib_accessor_class_number_of_coded_values.c +++ b/src/grib_accessor_class_number_of_coded_values.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_number_of_coded_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_number_of_points.c b/src/grib_accessor_class_number_of_points.c index fda0c6358..f5e35590a 100644 --- a/src/grib_accessor_class_number_of_points.c +++ b/src/grib_accessor_class_number_of_points.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_number_of_points = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_number_of_points_gaussian.c b/src/grib_accessor_class_number_of_points_gaussian.c index db9a75b24..6c6af1986 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.c +++ b/src/grib_accessor_class_number_of_points_gaussian.c @@ -110,7 +110,9 @@ static grib_accessor_class _grib_accessor_class_number_of_points_gaussian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -152,7 +154,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_number_of_values.c b/src/grib_accessor_class_number_of_values.c index 8f96090ef..fb84b7fa4 100644 --- a/src/grib_accessor_class_number_of_values.c +++ b/src/grib_accessor_class_number_of_values.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_number_of_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_number_of_values_data_raw_packing.c b/src/grib_accessor_class_number_of_values_data_raw_packing.c index 8a61a6016..be6ff1899 100644 --- a/src/grib_accessor_class_number_of_values_data_raw_packing.c +++ b/src/grib_accessor_class_number_of_values_data_raw_packing.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_number_of_values_data_raw_packin 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -143,7 +145,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_octahedral_gaussian.c b/src/grib_accessor_class_octahedral_gaussian.c index 1d7bd0c37..dc88d329a 100644 --- a/src/grib_accessor_class_octahedral_gaussian.c +++ b/src/grib_accessor_class_octahedral_gaussian.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_octahedral_gaussian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_octet_number.c b/src/grib_accessor_class_octet_number.c index 3774c2291..9650e09e0 100644 --- a/src/grib_accessor_class_octet_number.c +++ b/src/grib_accessor_class_octet_number.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_octet_number = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_offset_file.c b/src/grib_accessor_class_offset_file.c index d3cfe77b4..d923c87c2 100644 --- a/src/grib_accessor_class_offset_file.c +++ b/src/grib_accessor_class_offset_file.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_offset_file = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_offset_values.c b/src/grib_accessor_class_offset_values.c index 3df6461e4..e72d892f4 100644 --- a/src/grib_accessor_class_offset_values.c +++ b/src/grib_accessor_class_offset_values.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_offset_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_pack_bufr_values.c b/src/grib_accessor_class_pack_bufr_values.c index 89898494e..b51f90021 100644 --- a/src/grib_accessor_class_pack_bufr_values.c +++ b/src/grib_accessor_class_pack_bufr_values.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_pack_bufr_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_pad.c b/src/grib_accessor_class_pad.c index fc52a536c..7f19c1c73 100644 --- a/src/grib_accessor_class_pad.c +++ b/src/grib_accessor_class_pad.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_pad = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_padding.c b/src/grib_accessor_class_padding.c index a7588c6ba..5f8900c6a 100644 --- a/src/grib_accessor_class_padding.c +++ b/src/grib_accessor_class_padding.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_padding = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_padto.c b/src/grib_accessor_class_padto.c index 5df9d3fa1..233a751d2 100644 --- a/src/grib_accessor_class_padto.c +++ b/src/grib_accessor_class_padto.c @@ -92,7 +92,9 @@ static grib_accessor_class _grib_accessor_class_padto = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_padtoeven.c b/src/grib_accessor_class_padtoeven.c index c3aa1a2e9..3f37d7c78 100644 --- a/src/grib_accessor_class_padtoeven.c +++ b/src/grib_accessor_class_padtoeven.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_padtoeven = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_padtomultiple.c b/src/grib_accessor_class_padtomultiple.c index 0cf3a4c43..e57d33788 100644 --- a/src/grib_accessor_class_padtomultiple.c +++ b/src/grib_accessor_class_padtomultiple.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_padtomultiple = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_position.c b/src/grib_accessor_class_position.c index de4ec7790..eed88cd38 100644 --- a/src/grib_accessor_class_position.c +++ b/src/grib_accessor_class_position.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_position = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_proj_string.c b/src/grib_accessor_class_proj_string.c index abe5b1737..954625bb4 100644 --- a/src/grib_accessor_class_proj_string.c +++ b/src/grib_accessor_class_proj_string.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_proj_string = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -130,7 +132,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_raw.c b/src/grib_accessor_class_raw.c index 04614f595..ec2a89dc4 100644 --- a/src/grib_accessor_class_raw.c +++ b/src/grib_accessor_class_raw.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_raw = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_rdbtime_guess_date.c b/src/grib_accessor_class_rdbtime_guess_date.c index a1678476b..33b380520 100644 --- a/src/grib_accessor_class_rdbtime_guess_date.c +++ b/src/grib_accessor_class_rdbtime_guess_date.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_rdbtime_guess_date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_reference_value_error.c b/src/grib_accessor_class_reference_value_error.c index 0f7b137b6..8b94991b4 100644 --- a/src/grib_accessor_class_reference_value_error.c +++ b/src/grib_accessor_class_reference_value_error.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_reference_value_error = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_round.c b/src/grib_accessor_class_round.c index de83abb31..d15a5b83a 100644 --- a/src/grib_accessor_class_round.c +++ b/src/grib_accessor_class_round.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_round = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_scale.c b/src/grib_accessor_class_scale.c index a545c6f15..9ebab9e2b 100644 --- a/src/grib_accessor_class_scale.c +++ b/src/grib_accessor_class_scale.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_scale = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -141,7 +143,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_scale_values.c b/src/grib_accessor_class_scale_values.c index 30ab46b89..1f62cd902 100644 --- a/src/grib_accessor_class_scale_values.c +++ b/src/grib_accessor_class_scale_values.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_scale_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_second_order_bits_per_value.c b/src/grib_accessor_class_second_order_bits_per_value.c index 182d9e113..5f6db240a 100644 --- a/src/grib_accessor_class_second_order_bits_per_value.c +++ b/src/grib_accessor_class_second_order_bits_per_value.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_second_order_bits_per_value = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -139,7 +141,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_section.c b/src/grib_accessor_class_section.c index f15a944ff..12abc49e8 100644 --- a/src/grib_accessor_class_section.c +++ b/src/grib_accessor_class_section.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_section = { &next, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_section_length.c b/src/grib_accessor_class_section_length.c index c2a29271e..4d51be289 100644 --- a/src/grib_accessor_class_section_length.c +++ b/src/grib_accessor_class_section_length.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_section_length = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -130,7 +132,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_section_padding.c b/src/grib_accessor_class_section_padding.c index b03dcfbe9..3d4cab230 100644 --- a/src/grib_accessor_class_section_padding.c +++ b/src/grib_accessor_class_section_padding.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_section_padding = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_section_pointer.c b/src/grib_accessor_class_section_pointer.c index 62229e039..687f35d73 100644 --- a/src/grib_accessor_class_section_pointer.c +++ b/src/grib_accessor_class_section_pointer.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_section_pointer = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_select_step_template.c b/src/grib_accessor_class_select_step_template.c index aee085388..2da747dcd 100644 --- a/src/grib_accessor_class_select_step_template.c +++ b/src/grib_accessor_class_select_step_template.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_select_step_template = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -139,7 +141,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_sexagesimal2decimal.c b/src/grib_accessor_class_sexagesimal2decimal.c index b78b955f5..31683d2ed 100644 --- a/src/grib_accessor_class_sexagesimal2decimal.c +++ b/src/grib_accessor_class_sexagesimal2decimal.c @@ -95,7 +95,9 @@ static grib_accessor_class _grib_accessor_class_sexagesimal2decimal = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_signed.c b/src/grib_accessor_class_signed.c index 2767c0236..6c5606be0 100644 --- a/src/grib_accessor_class_signed.c +++ b/src/grib_accessor_class_signed.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_signed = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_signed_bits.c b/src/grib_accessor_class_signed_bits.c index 7fc1abd16..de9aab6fe 100644 --- a/src/grib_accessor_class_signed_bits.c +++ b/src/grib_accessor_class_signed_bits.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_signed_bits = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_simple_packing_error.c b/src/grib_accessor_class_simple_packing_error.c index c64a82409..54ee2d426 100644 --- a/src/grib_accessor_class_simple_packing_error.c +++ b/src/grib_accessor_class_simple_packing_error.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_simple_packing_error = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_size.c b/src/grib_accessor_class_size.c index ff024190a..e6b305414 100644 --- a/src/grib_accessor_class_size.c +++ b/src/grib_accessor_class_size.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_size = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,7 +130,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_smart_table.c b/src/grib_accessor_class_smart_table.c index 687a5bfd6..6291f6eb0 100644 --- a/src/grib_accessor_class_smart_table.c +++ b/src/grib_accessor_class_smart_table.c @@ -121,7 +121,9 @@ static grib_accessor_class _grib_accessor_class_smart_table = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -159,7 +161,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_smart_table_column.c b/src/grib_accessor_class_smart_table_column.c index 083c3b5bf..2c307240b 100644 --- a/src/grib_accessor_class_smart_table_column.c +++ b/src/grib_accessor_class_smart_table_column.c @@ -94,7 +94,9 @@ static grib_accessor_class _grib_accessor_class_smart_table_column = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_spd.c b/src/grib_accessor_class_spd.c index 9d6aa3bd3..06b8d0e66 100644 --- a/src/grib_accessor_class_spd.c +++ b/src/grib_accessor_class_spd.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_spd = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_spectral_truncation.c b/src/grib_accessor_class_spectral_truncation.c index f5cb89cd6..98c4f30ae 100644 --- a/src/grib_accessor_class_spectral_truncation.c +++ b/src/grib_accessor_class_spectral_truncation.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_spectral_truncation = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_sprintf.c b/src/grib_accessor_class_sprintf.c index 317a05402..4b39122e0 100644 --- a/src/grib_accessor_class_sprintf.c +++ b/src/grib_accessor_class_sprintf.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_sprintf = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_statistics.c b/src/grib_accessor_class_statistics.c index 1ab3debfd..0669ed7b2 100644 --- a/src/grib_accessor_class_statistics.c +++ b/src/grib_accessor_class_statistics.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_statistics = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_statistics_spectral.c b/src/grib_accessor_class_statistics_spectral.c index b2b200a48..0d4b47d94 100644 --- a/src/grib_accessor_class_statistics_spectral.c +++ b/src/grib_accessor_class_statistics_spectral.c @@ -107,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_statistics_spectral = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -147,7 +149,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_step_human_readable.c b/src/grib_accessor_class_step_human_readable.c index dea4b8ce6..eefa3f902 100644 --- a/src/grib_accessor_class_step_human_readable.c +++ b/src/grib_accessor_class_step_human_readable.c @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_step_human_readable = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -130,7 +132,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_step_in_units.c b/src/grib_accessor_class_step_in_units.c index fec21ead6..ce1cbcdba 100644 --- a/src/grib_accessor_class_step_in_units.c +++ b/src/grib_accessor_class_step_in_units.c @@ -98,7 +98,9 @@ static grib_accessor_class _grib_accessor_class_step_in_units = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -138,7 +140,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_sum.c b/src/grib_accessor_class_sum.c index eb195e513..db7d3843a 100644 --- a/src/grib_accessor_class_sum.c +++ b/src/grib_accessor_class_sum.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_sum = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_suppressed.c b/src/grib_accessor_class_suppressed.c index 9538e95e3..64d9657bb 100644 --- a/src/grib_accessor_class_suppressed.c +++ b/src/grib_accessor_class_suppressed.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_suppressed = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -132,7 +134,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_time.c b/src/grib_accessor_class_time.c index 52f155962..1bdfdec7b 100644 --- a/src/grib_accessor_class_time.c +++ b/src/grib_accessor_class_time.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_time = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -135,7 +137,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_times.c b/src/grib_accessor_class_times.c index cc6809eb4..b0b27baf6 100644 --- a/src/grib_accessor_class_times.c +++ b/src/grib_accessor_class_times.c @@ -96,7 +96,9 @@ static grib_accessor_class _grib_accessor_class_times = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index d9a6b5dec..0110b5cc1 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -113,7 +113,9 @@ static grib_accessor_class _grib_accessor_class_to_double = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -144,7 +146,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_to_integer.c b/src/grib_accessor_class_to_integer.c index 55d7ae985..7d74b40f8 100644 --- a/src/grib_accessor_class_to_integer.c +++ b/src/grib_accessor_class_to_integer.c @@ -111,7 +111,9 @@ static grib_accessor_class _grib_accessor_class_to_integer = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_to_string.c b/src/grib_accessor_class_to_string.c index 3de83fa06..b7f9f05ca 100644 --- a/src/grib_accessor_class_to_string.c +++ b/src/grib_accessor_class_to_string.c @@ -111,7 +111,9 @@ static grib_accessor_class _grib_accessor_class_to_string = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_transient.c b/src/grib_accessor_class_transient.c index bf2a76201..158351e31 100644 --- a/src/grib_accessor_class_transient.c +++ b/src/grib_accessor_class_transient.c @@ -86,7 +86,9 @@ static grib_accessor_class _grib_accessor_class_transient = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -129,7 +131,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_transient_darray.c b/src/grib_accessor_class_transient_darray.c index bfa18589e..19fec9f56 100644 --- a/src/grib_accessor_class_transient_darray.c +++ b/src/grib_accessor_class_transient_darray.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_transient_darray = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -134,7 +136,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_trim.c b/src/grib_accessor_class_trim.c index 21da77b53..86b18376f 100644 --- a/src/grib_accessor_class_trim.c +++ b/src/grib_accessor_class_trim.c @@ -93,7 +93,9 @@ static grib_accessor_class _grib_accessor_class_trim = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint16.c b/src/grib_accessor_class_uint16.c index 905e160b2..cbf1eba05 100644 --- a/src/grib_accessor_class_uint16.c +++ b/src/grib_accessor_class_uint16.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_uint16 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint16_little_endian.c b/src/grib_accessor_class_uint16_little_endian.c index 3ad93b61d..42cc1ed6c 100644 --- a/src/grib_accessor_class_uint16_little_endian.c +++ b/src/grib_accessor_class_uint16_little_endian.c @@ -85,7 +85,9 @@ static grib_accessor_class _grib_accessor_class_uint16_little_endian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -126,7 +128,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint32.c b/src/grib_accessor_class_uint32.c index f68387d97..c29a9c7f2 100644 --- a/src/grib_accessor_class_uint32.c +++ b/src/grib_accessor_class_uint32.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_uint32 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint32_little_endian.c b/src/grib_accessor_class_uint32_little_endian.c index 14daad975..6938f7284 100644 --- a/src/grib_accessor_class_uint32_little_endian.c +++ b/src/grib_accessor_class_uint32_little_endian.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_uint32_little_endian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint64.c b/src/grib_accessor_class_uint64.c index bda6395fd..c2f240b29 100644 --- a/src/grib_accessor_class_uint64.c +++ b/src/grib_accessor_class_uint64.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_uint64 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint64_little_endian.c b/src/grib_accessor_class_uint64_little_endian.c index d5b3f8342..d7aaa3aba 100644 --- a/src/grib_accessor_class_uint64_little_endian.c +++ b/src/grib_accessor_class_uint64_little_endian.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_uint64_little_endian = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_uint8.c b/src/grib_accessor_class_uint8.c index 9207aec16..b9d4fc665 100644 --- a/src/grib_accessor_class_uint8.c +++ b/src/grib_accessor_class_uint8.c @@ -87,7 +87,9 @@ static grib_accessor_class _grib_accessor_class_uint8 = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -127,7 +129,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_unexpanded_descriptors.c b/src/grib_accessor_class_unexpanded_descriptors.c index a3dce70ad..e0c31460b 100644 --- a/src/grib_accessor_class_unexpanded_descriptors.c +++ b/src/grib_accessor_class_unexpanded_descriptors.c @@ -100,7 +100,9 @@ static grib_accessor_class _grib_accessor_class_unexpanded_descriptors = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -136,7 +138,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_unpack_bufr_values.c b/src/grib_accessor_class_unpack_bufr_values.c index 28122705d..0f02df1d6 100644 --- a/src/grib_accessor_class_unpack_bufr_values.c +++ b/src/grib_accessor_class_unpack_bufr_values.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_unpack_bufr_values = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -133,7 +135,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_unsigned.c b/src/grib_accessor_class_unsigned.c index 1738886dd..1ffe1c385 100644 --- a/src/grib_accessor_class_unsigned.c +++ b/src/grib_accessor_class_unsigned.c @@ -103,7 +103,9 @@ static grib_accessor_class _grib_accessor_class_unsigned = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_unsigned_bits.c b/src/grib_accessor_class_unsigned_bits.c index 39d659880..d675bab7c 100644 --- a/src/grib_accessor_class_unsigned_bits.c +++ b/src/grib_accessor_class_unsigned_bits.c @@ -102,7 +102,9 @@ static grib_accessor_class _grib_accessor_class_unsigned_bits = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -137,7 +139,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_validity_date.c b/src/grib_accessor_class_validity_date.c index 9e514d92a..9d8c5cab1 100644 --- a/src/grib_accessor_class_validity_date.c +++ b/src/grib_accessor_class_validity_date.c @@ -101,7 +101,9 @@ static grib_accessor_class _grib_accessor_class_validity_date = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -142,7 +144,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_validity_time.c b/src/grib_accessor_class_validity_time.c index aa2a5d3ee..64ae1a197 100644 --- a/src/grib_accessor_class_validity_time.c +++ b/src/grib_accessor_class_validity_time.c @@ -99,7 +99,9 @@ static grib_accessor_class _grib_accessor_class_validity_time = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_values.c b/src/grib_accessor_class_values.c index cca5d9459..3d5ec2818 100644 --- a/src/grib_accessor_class_values.c +++ b/src/grib_accessor_class_values.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_values = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -144,7 +146,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_variable.c b/src/grib_accessor_class_variable.c index 7b0e91525..306578968 100644 --- a/src/grib_accessor_class_variable.c +++ b/src/grib_accessor_class_variable.c @@ -109,7 +109,9 @@ static grib_accessor_class _grib_accessor_class_variable = { 0, /* next accessor */ &compare, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ &make_clone, /* clone accessor */ @@ -140,7 +142,9 @@ static void init_class(grib_accessor_class* c) c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; c->next = (*(c->super))->next; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; } diff --git a/src/grib_accessor_class_vector.c b/src/grib_accessor_class_vector.c index fda5c6017..26b870001 100644 --- a/src/grib_accessor_class_vector.c +++ b/src/grib_accessor_class_vector.c @@ -97,7 +97,9 @@ static grib_accessor_class _grib_accessor_class_vector = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -139,7 +141,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_accessor_class_when.c b/src/grib_accessor_class_when.c index f2454c4f1..1f2c1f57b 100644 --- a/src/grib_accessor_class_when.c +++ b/src/grib_accessor_class_when.c @@ -90,7 +90,9 @@ static grib_accessor_class _grib_accessor_class_when = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -131,7 +133,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; diff --git a/src/grib_api.h b/src/grib_api.h index bc7f5fb51..b005771d0 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -800,6 +800,7 @@ int grib_get_double(const grib_handle* h, const char* key, double* value); * @return 0 if OK, integer value on error */ int grib_get_double_element(const grib_handle* h, const char* key, int i, double* value); +int grib_get_float_element(const grib_handle* h, const char* key, int i, float* value); /** * Get as double array the elements of the "key" array whose indexes are listed in the input array "index_array" @@ -812,6 +813,7 @@ int grib_get_double_element(const grib_handle* h, const char* key, int i, double * @return 0 if OK, integer value on error */ int grib_get_double_elements(const grib_handle* h, const char* key, const int* index_array, long size, double* value); +int grib_get_float_elements(const grib_handle* h, const char* key, const int* index_array, long size, float* value); /** * Get a string value from a key, if several keys of the same name are present, the last one is returned diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 63533afb9..6ad045530 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -308,7 +308,6 @@ typedef long (*iterator_has_next_proc)(grib_iterator* i); typedef int (*grib_pack_proc)(grib_handle* h, const double* in, size_t inlen, void* out, size_t* outlen); typedef int (*grib_unpack_proc)(grib_handle* h, const void* in, size_t inlen, double* out, size_t* outlen); - typedef void (*accessor_destroy_proc)(grib_context*, grib_accessor*); typedef int (*accessor_unpack_long_proc)(grib_accessor*, long*, size_t* len); @@ -316,7 +315,9 @@ typedef int (*accessor_unpack_double_proc)(grib_accessor*, double*, size_t* len) typedef int (*accessor_unpack_float_proc)(grib_accessor*, float*, size_t* len); typedef int (*accessor_unpack_double_element_proc)(grib_accessor*, size_t, double*); +typedef int (*accessor_unpack_float_element_proc)(grib_accessor*, size_t, float*); typedef int (*accessor_unpack_double_element_set_proc)(grib_accessor*, const size_t*, size_t, double*); +typedef int (*accessor_unpack_float_element_set_proc)(grib_accessor*, const size_t*, size_t, float*); typedef int (*accessor_unpack_double_subarray_proc)(grib_accessor*, double*, size_t, size_t); typedef int (*accessor_unpack_string_proc)(grib_accessor*, char*, size_t* len); @@ -984,7 +985,9 @@ struct grib_accessor_class accessor_next_proc next; accessor_compare_proc compare; accessor_unpack_double_element_proc unpack_double_element; + accessor_unpack_float_element_proc unpack_float_element; accessor_unpack_double_element_set_proc unpack_double_element_set; + accessor_unpack_float_element_set_proc unpack_float_element_set; accessor_unpack_double_subarray_proc unpack_double_subarray; accessor_clear_proc clear; accessor_clone_proc make_clone; diff --git a/src/grib_value.c b/src/grib_value.c index ffbad3cc7..4ff36ad2c 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1054,6 +1054,15 @@ int grib_get_double_element(const grib_handle* h, const char* name, int i, doubl } return GRIB_NOT_FOUND; } +int grib_get_float_element(const grib_handle* h, const char* name, int i, float* val) +{ + grib_accessor* act = grib_find_accessor(h, name); + + if (act) { + return grib_unpack_float_element(act, i, val); + } + return GRIB_NOT_FOUND; +} int grib_get_double_element_set_internal(grib_handle* h, const char* name, const size_t* index_array, size_t len, double* val_array) { @@ -1066,6 +1075,17 @@ int grib_get_double_element_set_internal(grib_handle* h, const char* name, const return ret; } +int grib_get_float_element_set_internal(grib_handle* h, const char* name, const size_t* index_array, size_t len, float* val_array) +{ + int ret = grib_get_float_element_set(h, name, index_array, len, val_array); + + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as float element set (%s)", + name, grib_get_error_message(ret)); + + return ret; +} int grib_get_double_element_set(const grib_handle* h, const char* name, const size_t* index_array, size_t len, double* val_array) { @@ -1076,6 +1096,15 @@ int grib_get_double_element_set(const grib_handle* h, const char* name, const si } return GRIB_NOT_FOUND; } +int grib_get_float_element_set(const grib_handle* h, const char* name, const size_t* index_array, size_t len, float* val_array) +{ + grib_accessor* acc = grib_find_accessor(h, name); + + if (acc) { + return grib_unpack_float_element_set(acc, index_array, len, val_array); + } + return GRIB_NOT_FOUND; +} int grib_points_get_values(grib_handle* h, grib_points* points, double* val) { @@ -1141,6 +1170,10 @@ int grib_get_double_elements(const grib_handle* h, const char* name, const int* return err; } +int grib_get_float_elements(const grib_handle* h, const char* name, const int* index_array, long len, float* val_array) +{ + return GRIB_NOT_IMPLEMENTED; +} int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length) { From 6fcef54935dfd6c9bd8d3c857864b5bb93ee3831 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 31 Dec 2022 14:27:06 +0000 Subject: [PATCH 015/212] ECC-1467: GRIB: Support data values array decoded as floats (Part 06) --- src/eccodes.c | 10 ++++++++++ src/eccodes.h | 2 ++ src/eccodes_prototypes.h | 3 +++ src/grib_api.h | 2 ++ src/grib_value.c | 16 ++++++++++++++++ 5 files changed, 33 insertions(+) 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) { From ffc9f1344781506969dd69009f62bf92a52627df Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 2 Jan 2023 14:58:57 +0000 Subject: [PATCH 016/212] ECC-1467: cpplint warnings --- src/grib_accessor_class_bitmap.c | 2 +- src/grib_accessor_class_data_apply_bitmap.c | 2 +- src/grib_accessor_class_data_ccsds_packing.c | 4 ++-- src/grib_accessor_class_gen.c | 2 +- src/grib_bits_any_endian_simple.c | 2 +- src/grib_value.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index 198e33238..4b7824a25 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -272,7 +272,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! static int unpack_float(grib_accessor* a, float* val, size_t* len) { long pos = a->offset * 8; diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index 148cf7207..0a3755bcb 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -269,7 +269,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! // Should be merged with unpack_double and refactored! Most probably using C++ templates static int unpack_float(grib_accessor* a, float* val, size_t* len) { diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 26c6aa4e3..55c4e404e 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -334,8 +334,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! -// Should be merged with unpack_double and refactored! Most probably using C++ templates +// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// Should be merged with unpack_double and refactored! Most probably using C++ templates static int unpack_float(grib_accessor* a, float* val, size_t* len) { grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index cc2f39662..cefdacb9b 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -343,7 +343,7 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } -//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! static int unpack_float(grib_accessor* a, float* v, size_t* len) { return GRIB_NOT_IMPLEMENTED; diff --git a/src/grib_bits_any_endian_simple.c b/src/grib_bits_any_endian_simple.c index e428f68d5..0654eb5b8 100644 --- a/src/grib_bits_any_endian_simple.c +++ b/src/grib_bits_any_endian_simple.c @@ -164,7 +164,7 @@ int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerVal return 0; } -//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! // This and the grib_decode_double_array function // should be merged and refactored! Most probably using C++ templates int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, diff --git a/src/grib_value.c b/src/grib_value.c index 80d30749d..0a948b4f4 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1367,7 +1367,7 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s } } -//TODO: ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) { size_t len = *length; From d1275b0963570b0e3e5c8337990f768b52402df5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 2 Jan 2023 17:59:22 +0000 Subject: [PATCH 017/212] ECC-1467: Placeholder for spherical harmonics (to be done) --- src/grib_accessor_class_data_complex_packing.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index b538ea497..b8822d4d3 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -18,6 +18,7 @@ CLASS = accessor SUPER = grib_accessor_class_data_simple_packing IMPLEMENTS = unpack_double + IMPLEMENTS = unpack_float IMPLEMENTS = pack_double IMPLEMENTS = value_count IMPLEMENTS = init @@ -48,6 +49,7 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_double(grib_accessor*, const double* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); @@ -112,7 +114,7 @@ static grib_accessor_class _grib_accessor_class_data_complex_packing = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -154,7 +156,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -448,6 +449,11 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } +// TODO(masn): ECC-1467 +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return GRIB_NOT_IMPLEMENTED; +} #define MAXVAL(a, b) a > b ? a : b From dab6eef442b3ac805de22e7eff389fb509979f6a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 2 Jan 2023 18:19:34 +0000 Subject: [PATCH 018/212] ECC-1467: TODO items --- src/grib_accessor_class_bitmap.c | 2 +- src/grib_accessor_class_data_apply_bitmap.c | 2 +- src/grib_accessor_class_data_ccsds_packing.c | 2 +- src/grib_accessor_class_data_complex_packing.c | 2 +- src/grib_accessor_class_gen.c | 2 +- src/grib_bits_any_endian_simple.c | 2 +- src/grib_value.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_bitmap.c b/src/grib_accessor_class_bitmap.c index 4b7824a25..3bcbc04c3 100644 --- a/src/grib_accessor_class_bitmap.c +++ b/src/grib_accessor_class_bitmap.c @@ -272,7 +272,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } -// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! static int unpack_float(grib_accessor* a, float* val, size_t* len) { long pos = a->offset * 8; diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index 0a3755bcb..13c770b7c 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -269,7 +269,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! // Should be merged with unpack_double and refactored! Most probably using C++ templates static int unpack_float(grib_accessor* a, float* val, size_t* len) { diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index 55c4e404e..a1c1c24b4 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -334,7 +334,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! // Should be merged with unpack_double and refactored! Most probably using C++ templates static int unpack_float(grib_accessor* a, float* val, size_t* len) { diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index b8822d4d3..bf3eec285 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -449,7 +449,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } -// TODO(masn): ECC-1467 +// TODO(maee): ECC-1467 static int unpack_float(grib_accessor* a, float* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index cefdacb9b..76138d8d8 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -343,7 +343,7 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } -// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! static int unpack_float(grib_accessor* a, float* v, size_t* len) { return GRIB_NOT_IMPLEMENTED; diff --git a/src/grib_bits_any_endian_simple.c b/src/grib_bits_any_endian_simple.c index 0654eb5b8..93e450a03 100644 --- a/src/grib_bits_any_endian_simple.c +++ b/src/grib_bits_any_endian_simple.c @@ -164,7 +164,7 @@ int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerVal return 0; } -// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! // This and the grib_decode_double_array function // should be merged and refactored! Most probably using C++ templates int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, diff --git a/src/grib_value.c b/src/grib_value.c index 0a948b4f4..3fcc58b64 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -1367,7 +1367,7 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s } } -// TODO(masn): ECC-1467: Copied the 'double' version and reused by copy/paste! +// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) { size_t len = *length; From 7e3889eeed9e02475800d64b7a0e328e7c4a342c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 5 Jan 2023 17:02:07 +0000 Subject: [PATCH 019/212] ECC-1502: BUFR encoding: Setting strings longer than the maximum length should fail --- src/grib_accessor_class_bufr_data_array.c | 20 ++++++++++++++++---- src/grib_bits_any_endian.c | 11 ++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.c b/src/grib_accessor_class_bufr_data_array.c index 222e9194e..6c28403e7 100644 --- a/src/grib_accessor_class_bufr_data_array.c +++ b/src/grib_accessor_class_bufr_data_array.c @@ -743,7 +743,12 @@ static int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bu modifiedWidth = bd->width; grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); - grib_encode_string(buff->data, pos, modifiedWidth / 8, stringValues->v[ival]); + err = grib_encode_string(buff->data, pos, modifiedWidth / 8, stringValues->v[ival]); + if (err) { + grib_context_log(c, GRIB_LOG_ERROR, "encode_string_array: %s. Failed to encode '%s'", + bd->shortName, stringValues->v[ival]); + return err; + } width = n > 1 ? modifiedWidth : 0; grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + 6); @@ -752,7 +757,12 @@ static int encode_string_array(grib_context* c, grib_buffer* buff, long* pos, bu grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + width * n); for (j = 0; j < n; j++) { k = self->iss_list->v[j]; - grib_encode_string(buff->data, pos, width / 8, stringValues->v[k]); + err = grib_encode_string(buff->data, pos, width / 8, stringValues->v[k]); + if (err) { + grib_context_log(c, GRIB_LOG_ERROR, "encode_string_array: %s. Failed to encode '%s'", + bd->shortName, stringValues->v[k]); + return err; + } } } return err; @@ -1057,8 +1067,10 @@ static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bu len = bd->width / 8; grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + bd->width); - - grib_encode_string(buff->data, pos, len, sval); + err = grib_encode_string(buff->data, pos, len, sval); + if (err) { + grib_context_log(c, GRIB_LOG_ERROR, "encode_string_value: %s. Failed to encode '%s'", bd->shortName, sval); + } return err; } diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index bcdc7eb2d..3c5059339 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -91,7 +91,7 @@ int grib_is_all_bits_one(int64_t val, long nbits) int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, const char* string) { - size_t i; + size_t i = 0, slen = 0; int err = 0; long byteOffset = *bitOffset / 8; int remainder = *bitOffset % 8; @@ -103,15 +103,20 @@ int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberO char* s = str; Assert(numberOfCharacters < 512); + Assert(string); - if (string) - memcpy(s, string, strlen(string)); + slen = strlen(string); + memcpy(s, string, slen); /* if (remainder) byteOffset++; */ if (numberOfCharacters == 0) return err; + if (slen > numberOfCharacters) { + return GRIB_ENCODING_ERROR; + } + p = (unsigned char*)bitStream + byteOffset; if (remainder == 0) { From e744bec7a26de6425e6ae21010317f830ef836a9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 5 Jan 2023 17:42:13 +0000 Subject: [PATCH 020/212] ECC-1502: Fortran encoding test --- src/grib_bits_any_endian.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/grib_bits_any_endian.c b/src/grib_bits_any_endian.c index 3c5059339..4b88eeb83 100644 --- a/src/grib_bits_any_endian.c +++ b/src/grib_bits_any_endian.c @@ -103,20 +103,26 @@ int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberO char* s = str; Assert(numberOfCharacters < 512); - Assert(string); - - slen = strlen(string); - memcpy(s, string, slen); + /* There is a case where string == NULL: + * bufr_dump -Efortran data/bufr/btem_109.bufr + * This writes: + * call codes_set(ibufr,'shipOrMobileLandStationIdentifier','') + * For some odd reason this gets passed in as a NULL string here! + * To be further investigated + */ + if (string) { + slen = strlen(string); + if (slen > numberOfCharacters) { + return GRIB_ENCODING_ERROR; + } + memcpy(s, string, slen); + } /* if (remainder) byteOffset++; */ if (numberOfCharacters == 0) return err; - if (slen > numberOfCharacters) { - return GRIB_ENCODING_ERROR; - } - p = (unsigned char*)bitStream + byteOffset; if (remainder == 0) { From b9524323378f78767f4a64e75483f82c9b1747e2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 5 Jan 2023 17:58:38 +0000 Subject: [PATCH 021/212] ECC-1502: Add test --- tests/bufr_filter_misc.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/bufr_filter_misc.sh b/tests/bufr_filter_misc.sh index 80c68e9b5..6e2171a4f 100755 --- a/tests/bufr_filter_misc.sh +++ b/tests/bufr_filter_misc.sh @@ -564,6 +564,27 @@ set -e ${tools_dir}/codes_bufr_filter -f $fRules $f 2>>$fLog 1>>$fLog +#----------------------------------------------------------- +# Test: with invalid string key +#----------------------------------------------------------- +cat > $fRules <> $fLog +${tools_dir}/codes_bufr_filter $fRules $f 2>> $fLog 1>> $fLog +if [ $? -eq 0 ]; then + echo "bufr_filter should have failed if string key is invalid" >&2 + exit 1 +fi +set -e + + #---------------------------------------------------- # Test: format specifier for integer keys #---------------------------------------------------- From 959e250717190a450e20524ae1b73f48d4bc88a9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Jan 2023 15:19:07 +0000 Subject: [PATCH 022/212] Get Bamboo CIE to work --- bamboo/GCC-env.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bamboo/GCC-env.sh b/bamboo/GCC-env.sh index 353a931b9..f7b6fb911 100644 --- a/bamboo/GCC-env.sh +++ b/bamboo/GCC-env.sh @@ -3,17 +3,17 @@ [[ $(uname) == "Darwin" ]] && return # initialise module environment if it is not -if [[ ! $(command -v module > /dev/null 2>&1) ]]; then - . /usr/local/apps/module/init/bash -fi +#if [[ ! $(command -v module > /dev/null 2>&1) ]]; then + #. /usr/local/apps/module/init/bash +#fi -module unload grib_api -module unload eccodes -module unload emos -module unload fftw -module unload libemos -module unload metview +#module unload grib_api +#module unload eccodes +#module unload emos +#module unload fftw +#module unload libemos +#module unload metview -module load cmake/3.16.5 -module load aec +#module load cmake/3.16.5 +#module load aec From d4b089ddade67e641d7ebd12be66cfffaf9bcbfe Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Jan 2023 15:29:07 +0000 Subject: [PATCH 023/212] Get Bamboo CIE to work --- bamboo/GCC-env.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bamboo/GCC-env.sh b/bamboo/GCC-env.sh index f7b6fb911..fa0ef99e4 100644 --- a/bamboo/GCC-env.sh +++ b/bamboo/GCC-env.sh @@ -4,9 +4,11 @@ # initialise module environment if it is not #if [[ ! $(command -v module > /dev/null 2>&1) ]]; then - #. /usr/local/apps/module/init/bash +# . /usr/local/apps/module/init/bash #fi +echo "Got to here........" + #module unload grib_api #module unload eccodes #module unload emos From 2569de6aac3248fb43e30354dc4dd6dd4ed2e1d6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 27 Jan 2023 16:57:42 +0000 Subject: [PATCH 024/212] Get Bamboo CIE to work --- bamboo/GCC-env.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bamboo/GCC-env.sh b/bamboo/GCC-env.sh index fa0ef99e4..043bcd488 100644 --- a/bamboo/GCC-env.sh +++ b/bamboo/GCC-env.sh @@ -1,14 +1,12 @@ #!/bin/bash -[[ $(uname) == "Darwin" ]] && return +# [[ $(uname) == "Darwin" ]] && return # initialise module environment if it is not #if [[ ! $(command -v module > /dev/null 2>&1) ]]; then # . /usr/local/apps/module/init/bash #fi -echo "Got to here........" - #module unload grib_api #module unload eccodes #module unload emos From 4f6d060d7ec64da2bfc90f63199fa5db3a8edc01 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 28 Jan 2023 21:20:01 +0000 Subject: [PATCH 025/212] ECC-1508: Scripts --- src/make_class.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/make_class.pl b/src/make_class.pl index b7abb2937..9f071952c 100755 --- a/src/make_class.pl +++ b/src/make_class.pl @@ -7,7 +7,7 @@ foreach $name ( @ARGV ) { - next unless($name =~ /\.c$/); + next unless($name =~ /\.cpp$/); print "$name\n" if ($verbose); open(IN,"<$name") or die "$name: $!"; @@ -345,9 +345,9 @@ sub parse_super { local $_; # Make sure it's up-to-date - system($0,"$name.c"); + system($0,"$name.cpp"); - open(S,"<$name.c") or die "$name.c: $!"; + open(S,"<$name.cpp") or die "$name.cpp: $!"; # print "SUPER: $name\n"; From 239cb19741381c4d1b048bfd12936e143de3cd9f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 28 Jan 2023 21:47:25 +0000 Subject: [PATCH 026/212] Bump up version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 377d44349..d3dea9e97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) find_package( ecbuild 3.7 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild) # Initialise project -project( eccodes VERSION 2.29.0 LANGUAGES CXX ) +project( eccodes VERSION 2.30.0 LANGUAGES CXX ) ############################################################################### # system checks needed for eccodes_config.h and some options like MEMFS From af1f5b8b75eb285ad80ec8d87914c24b2a4bfa1e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 28 Jan 2023 22:11:12 +0000 Subject: [PATCH 027/212] ECC-1508: Remove the old cmake option --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1f0feaa0b..4b0a3eaaa 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -77,7 +77,6 @@ build_script: -D ENABLE_AEC=0 ^ -D IEEE_LE=1 ^ -D ENABLE_MEMFS=1 ^ - -D ENABLE_EXPERIMENTAL_BUILD_WITH_CXX=1 ^ -D ENABLE_EXTRA_TESTS=ON ^ -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. From a269951e83974e6abaf95457aee17e8859bcf606 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 28 Jan 2023 22:16:25 +0000 Subject: [PATCH 028/212] ECC-1508: Set project language to be C++ --- src/eccodes_prototypes.h | 720 +++++++++++++++++++-------------------- 1 file changed, 360 insertions(+), 360 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index e3173e313..7314f0bab 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -2,7 +2,7 @@ #include #endif -/* action.c */ +/* action.cpp */ void grib_dump(grib_action* a, FILE* f, int l); void grib_xref(grib_action* a, FILE* f, const char* path); void grib_action_delete(grib_context* context, grib_action* a); @@ -14,102 +14,102 @@ void grib_dump_action_branch(FILE* out, grib_action* a, int decay); void grib_dump_action_tree(grib_context* ctx, FILE* out); void grib_xref_action_branch(FILE* out, grib_action* a, const char* path); -/* action_class_alias.c */ +/* action_class_alias.cpp */ grib_action* grib_action_create_alias(grib_context* context, const char* name, const char* arg1, const char* name_space, int flags); -/* action_class_gen.c */ +/* action_class_gen.cpp */ grib_action* grib_action_create_gen(grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space, const char* set); -/* action_class_if.c */ +/* action_class_if.cpp */ grib_action* grib_action_create_if(grib_context* context, grib_expression* expression, grib_action* block_true, grib_action* block_false, int transient, int lineno, char* file_being_parsed); -/* action_class_switch.c */ +/* action_class_switch.cpp */ grib_action* grib_action_create_switch(grib_context* context, grib_arguments* args, grib_case* Case, grib_action* Default); grib_case* grib_case_new(grib_context* c, grib_arguments* values, grib_action* action); -/* grib_accessor_class_g1fcperiod.c */ +/* grib_accessor_class_g1fcperiod.cpp */ -/* grib_accessor_class_g1end_of_interval_monthly.c */ +/* grib_accessor_class_g1end_of_interval_monthly.cpp */ -/* grib_accessor_class_mars_param.c */ +/* grib_accessor_class_mars_param.cpp */ -/* action_class_section.c */ +/* action_class_section.cpp */ -/* action_class_list.c */ +/* action_class_list.cpp*/ grib_action* grib_action_create_list(grib_context* context, const char* name, grib_expression* expression, grib_action* block); -/* action_class_while.c */ +/* action_class_while.cpp*/ grib_action* grib_action_create_while(grib_context* context, grib_expression* expression, grib_action* block); -/* action_class_put.c */ +/* action_class_put.cpp*/ grib_action* grib_action_create_put(grib_context* context, const char* name, grib_arguments* args); -/* action_class_meta.c */ +/* action_class_meta.cpp*/ grib_action* grib_action_create_meta(grib_context* context, const char* name, const char* op, grib_arguments* params, grib_arguments* default_value, unsigned long flags, const char* name_space); -/* action_class_remove.c */ +/* action_class_remove.cpp*/ grib_action* grib_action_create_remove(grib_context* context, grib_arguments* args); -/* action_class_rename.c */ +/* action_class_rename.cpp*/ grib_action* grib_action_create_rename(grib_context* context, char* the_old, char* the_new); -/* action_class_assert.c */ +/* action_class_assert.cpp*/ grib_action* grib_action_create_assert(grib_context* context, grib_expression* expression); -/* action_class_template.c */ +/* action_class_template.cpp*/ grib_action* grib_action_create_template(grib_context* context, int nofail, const char* name, const char* arg1); grib_action* get_empty_template(grib_context* c, int* err); -/* action_class_trigger.c */ +/* action_class_trigger.cpp*/ grib_action* grib_action_create_trigger(grib_context* context, grib_arguments* args, grib_action* block); -/* action_class_when.c */ +/* action_class_when.cpp*/ grib_action* grib_action_create_when(grib_context* context, grib_expression* expression, grib_action* block_true, grib_action* block_false); -/* action_class_concept.c */ +/* action_class_concept.cpp*/ grib_concept_value* action_concept_get_concept(grib_accessor* a); int action_concept_get_nofail(grib_accessor* a); grib_action* grib_action_create_concept(grib_context* context, const char* name, grib_concept_value* concept_value, const char* basename, const char* name_space, const char* defaultkey, const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail); int get_concept_condition_string(grib_handle* h, const char* key, const char* value, char* result); -/* action_class_hash_array.c */ +/* action_class_hash_array.cpp*/ grib_action* grib_action_create_hash_array(grib_context* context, const char* name, grib_hash_array_value* hash_array, const char* basename, const char* name_space, const char* defaultkey, const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail); grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a); -/* action_class_set.c */ +/* action_class_set.cpp*/ grib_action* grib_action_create_set(grib_context* context, const char* name, grib_expression* expression, int nofail); -/* action_class_set_darray.c */ +/* action_class_set_darray.cpp*/ grib_action* grib_action_create_set_darray(grib_context* context, const char* name, grib_darray* darray); -/* action_class_set_iarray.c */ +/* action_class_set_iarray.cpp*/ grib_action* grib_action_create_set_iarray(grib_context* context, const char* name, grib_iarray* iarray); -/* action_class_set_sarray.c */ +/* action_class_set_sarray.cpp*/ grib_action* grib_action_create_set_sarray(grib_context* context, const char* name, grib_sarray* sarray); -/* action_class_noop.c */ +/* action_class_noop.cpp*/ grib_action* grib_action_create_noop(grib_context* context, const char* fname); -/* action_class_write.c */ +/* action_class_write.cpp*/ grib_action* grib_action_create_write(grib_context* context, const char* name, int append, int padtomultiple); -/* action_class_print.c */ +/* action_class_print.cpp*/ grib_action* grib_action_create_print(grib_context* context, const char* name, char* outname); -/* action_class_close.c */ +/* action_class_close.cpp*/ grib_action* grib_action_create_close(grib_context* context, char* filename); -/* action_class_variable.c */ +/* action_class_variable.cpp*/ grib_action* grib_action_create_variable(grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space); -/* action_class_modify.c */ +/* action_class_modify.cpp*/ grib_action* grib_action_create_modify(grib_context* context, const char* name, long flags); -/* action_class_transient_darray.c */ +/* action_class_transient_darray.cpp*/ grib_action* grib_action_create_transient_darray(grib_context* context, const char* name, grib_darray* darray, int flags); -/* grib_accessor.c */ +/* grib_accessor.cpp*/ void grib_accessor_dump(grib_accessor* a, grib_dumper* f); int grib_pack_missing(grib_accessor* a); int grib_pack_zero(grib_accessor* a); @@ -162,18 +162,18 @@ grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al); grib_accessors_list* grib_accessors_list_find(grib_accessors_list* al, const grib_accessor* a); void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al); -/* grib_concept.c */ +/* grib_concept.cpp*/ grib_concept_value* grib_concept_value_new(grib_context* c, const char* name, grib_concept_condition* conditions); void grib_concept_value_delete(grib_context* c, grib_concept_value* v); grib_concept_condition* grib_concept_condition_new(grib_context* c, const char* name, grib_expression* expression, grib_iarray* iarray); void grib_concept_condition_delete(grib_context* c, grib_concept_condition* v); -/* grib_hash_array.c */ +/* grib_hash_array.cpp*/ grib_hash_array_value* grib_integer_hash_array_value_new(grib_context* c, const char* name, grib_iarray* array); grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c, const char* name, grib_darray* array); void grib_hash_array_value_delete(grib_context* c, grib_hash_array_value* v); -/* grib_bufr_descriptor.c */ +/* grib_bufr_descriptor.cpp*/ bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int silent, int* err); bufr_descriptor* grib_bufr_descriptor_clone(bufr_descriptor* d); int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor, int code, bufr_descriptor* v); @@ -183,7 +183,7 @@ void grib_bufr_descriptor_set_scale(bufr_descriptor* v, long scale); int grib_bufr_descriptor_can_be_missing(bufr_descriptor* v); void grib_bufr_descriptor_delete(bufr_descriptor* v); -/* grib_bufr_descriptors_array.c */ +/* grib_bufr_descriptors_array.cpp*/ bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c, size_t size, size_t incsize); bufr_descriptor* grib_bufr_descriptors_array_pop(bufr_descriptors_array* a); bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a); @@ -197,7 +197,7 @@ void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array* v); bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* v); size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array* v); -/* grib_darray.c */ +/* grib_darray.cpp*/ void grib_darray_print(const char* title, const grib_darray* darray); grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize); grib_darray* grib_darray_push(grib_context* c, grib_darray* v, double val); @@ -206,7 +206,7 @@ double* grib_darray_get_array(grib_context* c, grib_darray* v); int grib_darray_is_constant(grib_darray* v, double epsilon); size_t grib_darray_used_size(grib_darray* v); -/* grib_sarray.c */ +/* grib_sarray.cpp*/ void grib_sarray_print(const char* title, const grib_sarray* sarray); grib_sarray* grib_sarray_new(grib_context* c, size_t size, size_t incsize); grib_sarray* grib_sarray_push(grib_context* c, grib_sarray* v, char* val); @@ -215,7 +215,7 @@ void grib_sarray_delete_content(grib_context* c, grib_sarray* v); char** grib_sarray_get_array(grib_context* c, grib_sarray* v); size_t grib_sarray_used_size(grib_sarray* v); -/* grib_oarray.c */ +/* grib_oarray.cpp*/ grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize); grib_oarray* grib_oarray_push(grib_context* c, grib_oarray* v, void* val); void grib_oarray_delete(grib_context* c, grib_oarray* v); @@ -223,7 +223,7 @@ void** grib_oarray_get_array(grib_context* c, grib_oarray* v); void* grib_oarray_get(grib_oarray* v, int i); size_t grib_oarray_used_size(grib_oarray* v); -/* grib_iarray.c */ +/* grib_iarray.cpp*/ void grib_iarray_print(const char* title, const grib_iarray* iarray); grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize); long grib_iarray_pop(grib_iarray* a); @@ -236,7 +236,7 @@ void grib_iarray_delete_array(grib_iarray* v); long* grib_iarray_get_array(grib_iarray* v); size_t grib_iarray_used_size(grib_iarray* v); -/* grib_vdarray.c */ +/* grib_vdarray.cpp*/ void grib_vdarray_print(const char* title, const grib_vdarray* vdarray); grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize); grib_vdarray* grib_vdarray_push(grib_context* c, grib_vdarray* v, grib_darray* val); @@ -245,7 +245,7 @@ void grib_vdarray_delete_content(grib_context* c, grib_vdarray* v); grib_darray** grib_vdarray_get_array(grib_context* c, grib_vdarray* v); size_t grib_vdarray_used_size(grib_vdarray* v); -/* grib_vsarray.c */ +/* grib_vsarray.cpp*/ void grib_vsarray_print(const char* title, const grib_vsarray* vdarray); grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize); grib_vsarray* grib_vsarray_push(grib_context* c, grib_vsarray* v, grib_sarray* val); @@ -254,7 +254,7 @@ void grib_vsarray_delete_content(grib_context* c, grib_vsarray* v); grib_sarray** grib_vsarray_get_array(grib_context* c, grib_vsarray* v); size_t grib_vsarray_used_size(grib_vsarray* v); -/* grib_viarray.c */ +/* grib_viarray.cpp*/ void grib_viarray_print(const char* title, const grib_viarray* viarray); grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize); grib_viarray* grib_viarray_push(grib_context* c, grib_viarray* v, grib_iarray* val); @@ -263,27 +263,27 @@ void grib_viarray_delete_content(grib_context* c, grib_viarray* v); grib_iarray** grib_viarray_get_array(grib_context* c, grib_viarray* v); size_t grib_viarray_used_size(grib_viarray* v); -/* grib_accessor_class_array.c */ +/* grib_accessor_class_array.cpp*/ -/* grib_accessor_class_assert.c */ +/* grib_accessor_class_assert.cpp*/ -/* grib_accessor_class_ascii.c */ +/* grib_accessor_class_ascii.cpp*/ -/* grib_accessor_class_bit.c */ +/* grib_accessor_class_bit.cpp*/ -/* grib_accessor_class_bitmap.c */ +/* grib_accessor_class_bitmap.cpp*/ -/* grib_accessor_class_bits.c */ +/* grib_accessor_class_bits.cpp*/ -/* grib_accessor_class_bits_per_value.c */ +/* grib_accessor_class_bits_per_value.cpp*/ -/* grib_accessor_class_bufr_data_array.c */ +/* grib_accessor_class_bufr_data_array.cpp*/ grib_vsarray* accessor_bufr_data_array_get_stringValues(grib_accessor* a); grib_accessors_list* accessor_bufr_data_array_get_dataAccessors(grib_accessor* a); grib_trie_with_rank* accessor_bufr_data_array_get_dataAccessorsTrie(grib_accessor* a); void accessor_bufr_data_array_set_unpackMode(grib_accessor* a, int unpackMode); -/* grib_accessor_class_bufr_data_element.c */ +/* grib_accessor_class_bufr_data_element.cpp*/ void accessor_bufr_data_element_set_index(grib_accessor* a, long index); void accessor_bufr_data_element_set_type(grib_accessor* a, int type); void accessor_bufr_data_element_set_numberOfSubsets(grib_accessor* a, long numberOfSubsets); @@ -294,50 +294,50 @@ void accessor_bufr_data_element_set_numericValues(grib_accessor* a, grib_vdarray void accessor_bufr_data_element_set_stringValues(grib_accessor* a, grib_vsarray* stringValues); void accessor_bufr_data_element_set_elementsDescriptorsIndex(grib_accessor* a, grib_viarray* elementsDescriptorsIndex); -/* grib_accessor_class_bufr_elements_table.c */ +/* grib_accessor_class_bufr_elements_table.cpp*/ int bufr_descriptor_is_marker(bufr_descriptor* d); bufr_descriptor* accessor_bufr_elements_table_get_descriptor(grib_accessor* a, int code, int* err); -/* grib_accessor_class_bufr_group.c */ +/* grib_accessor_class_bufr_group.cpp*/ -/* grib_accessor_class_bufr_string_values.c */ +/* grib_accessor_class_bufr_string_values.cpp*/ -/* grib_accessor_class_pack_bufr_values.c */ +/* grib_accessor_class_pack_bufr_values.cpp*/ -/* grib_accessor_class_bufr_extract_area_subsets.c */ +/* grib_accessor_class_bufr_extract_area_subsets.cpp*/ -/* grib_accessor_class_bufr_extract_datetime_subsets.c */ +/* grib_accessor_class_bufr_extract_datetime_subsets.cpp*/ -/* grib_accessor_class_group.c */ +/* grib_accessor_class_group.cpp*/ -/* grib_accessor_class_unpack_bufr_values.c */ +/* grib_accessor_class_unpack_bufr_values.cpp*/ -/* grib_accessor_class_apply_operators.c */ +/* grib_accessor_class_apply_operators.cpp*/ size_t compute_size_AO(const long* descriptors, size_t numberOfDescriptors); -/* grib_accessor_class_non_alpha.c */ +/* grib_accessor_class_non_alpha.cpp*/ -/* grib_accessor_class_g1bitmap.c */ +/* grib_accessor_class_g1bitmap.cpp*/ -/* grib_accessor_class_g2bitmap.c */ +/* grib_accessor_class_g2bitmap.cpp*/ -/* grib_accessor_class_concept.c */ +/* grib_accessor_class_concept.cpp*/ -/* grib_accessor_class_hash_array.c */ +/* grib_accessor_class_hash_array.cpp*/ -/* grib_accessor_class_decimal_precision.c */ +/* grib_accessor_class_decimal_precision.cpp*/ -/* grib_accessor_class_divdouble.c */ +/* grib_accessor_class_divdouble.cpp*/ -/* grib_accessor_class_budgdate.c */ +/* grib_accessor_class_budgdate.cpp*/ -/* grib_accessor_class_validity_date.c */ +/* grib_accessor_class_validity_date.cpp*/ -/* grib_accessor_class_validity_time.c */ +/* grib_accessor_class_validity_time.cpp*/ -/* grib_accessor_class_bytes.c */ +/* grib_accessor_class_bytes.cpp*/ -/* grib_accessor_class.c */ +/* grib_accessor_class.cpp*/ grib_section* grib_create_root_section(const grib_context* context, grib_handle* h); grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, const long len, grib_arguments* params); void grib_push_accessor(grib_accessor* a, grib_block_of_accessors* l); @@ -347,347 +347,347 @@ int grib_get_block_length(grib_section* s, size_t* l); grib_accessor* find_paddings(grib_section* s); void grib_update_paddings(grib_section* s); -/* grib_accessor_class_change_scanning_direction.c */ +/* grib_accessor_class_change_scanning_direction.cpp*/ -/* grib_accessor_class_change_scanning_direction.c */ +/* grib_accessor_class_change_scanning_direction.cpp*/ -/* grib_accessor_class_check_internal_version.c */ +/* grib_accessor_class_check_internal_version.cpp*/ -/* grib_accessor_class_codeflag.c */ +/* grib_accessor_class_codeflag.cpp*/ -/* grib_accessor_class_smart_table.c */ +/* grib_accessor_class_smart_table.cpp*/ void grib_smart_table_delete(grib_context* c); -/* grib_accessor_class_smart_table_column.c */ +/* grib_accessor_class_smart_table_column.cpp*/ -/* grib_accessor_class_codetable.c */ +/* grib_accessor_class_codetable.cpp*/ void grib_codetable_delete(grib_context* c); -/* grib_accessor_class_codetable_units.c */ +/* grib_accessor_class_codetable_units.cpp*/ -/* grib_accessor_class_codetable_title.c */ +/* grib_accessor_class_codetable_title.cpp*/ -/* grib_accessor_class_count_file.c */ +/* grib_accessor_class_count_file.cpp*/ -/* grib_accessor_class_count_total.c */ +/* grib_accessor_class_count_total.cpp*/ -/* grib_accessor_class_double.c */ +/* grib_accessor_class_double.cpp*/ -/* grib_accessor_class_element.c */ +/* grib_accessor_class_element.cpp*/ -/* grib_accessor_class_evaluate.c */ +/* grib_accessor_class_evaluate.cpp*/ -/* grib_accessor_class_g1area.c */ +/* grib_accessor_class_g1area.cpp*/ -/* grib_accessor_class_g1date.c */ +/* grib_accessor_class_g1date.cpp*/ -/* grib_accessor_class_g1monthlydate.c */ +/* grib_accessor_class_g1monthlydate.cpp*/ -/* grib_accessor_class_library_version.c */ +/* grib_accessor_class_library_version.cpp*/ -/* grib_accessor_class_when.c */ +/* grib_accessor_class_when.cpp*/ -/* grib_accessor_class_g1verificationdate.c */ +/* grib_accessor_class_g1verificationdate.cpp*/ -/* grib_accessor_class_g1day_of_the_year_date.c */ +/* grib_accessor_class_g1day_of_the_year_date.cpp*/ -/* grib_accessor_class_g1_half_byte_codeflag.c */ +/* grib_accessor_class_g1_half_byte_codeflag.cpp*/ -/* grib_accessor_class_g1forecastmonth.c */ +/* grib_accessor_class_g1forecastmonth.cpp*/ -/* grib_accessor_class_g1step_range.c */ +/* grib_accessor_class_g1step_range.cpp*/ int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd); -/* grib_accessor_class_g2step_range.c */ +/* grib_accessor_class_g2step_range.cpp*/ -/* grib_accessor_class_data_g22order_packing.c */ +/* grib_accessor_class_data_g22order_packing.cpp*/ -/* grib_accessor_class_mars_step.c */ +/* grib_accessor_class_mars_step.cpp*/ -/* grib_accessor_class_message_copy.c */ +/* grib_accessor_class_message_copy.cpp*/ -/* grib_accessor_class_dictionary.c */ +/* grib_accessor_class_dictionary.cpp*/ -/* grib_accessor_class_latlon_increment.c */ +/* grib_accessor_class_latlon_increment.cpp*/ -/* grib_accessor_class_g2date.c */ +/* grib_accessor_class_g2date.cpp*/ -/* grib_accessor_class_g2level.c */ +/* grib_accessor_class_g2level.cpp*/ -/* grib_accessor_class_g2end_step.c */ +/* grib_accessor_class_g2end_step.cpp*/ -/* grib_accessor_class_g2latlon.c */ +/* grib_accessor_class_g2latlon.cpp*/ -/* grib_accessor_class_g2lon.c */ +/* grib_accessor_class_g2lon.cpp*/ -/* grib_accessor_class_global_gaussian.c */ +/* grib_accessor_class_global_gaussian.cpp*/ -/* grib_accessor_class_gaussian_grid_name.c */ +/* grib_accessor_class_gaussian_grid_name.cpp*/ -/* grib_accessor_class_gen.c */ +/* grib_accessor_class_gen.cpp*/ -/* grib_accessor_class_gts_header.c */ +/* grib_accessor_class_gts_header.cpp*/ -/* grib_accessor_class_ifs_param.c */ +/* grib_accessor_class_ifs_param.cpp*/ -/* grib_accessor_class_int16.c */ +/* grib_accessor_class_int16.cpp*/ -/* grib_accessor_class_int16_little_endian.c */ +/* grib_accessor_class_int16_little_endian.cpp*/ -/* grib_accessor_class_int32.c */ +/* grib_accessor_class_int32.cpp*/ -/* grib_accessor_class_int32_little_endian.c */ +/* grib_accessor_class_int32_little_endian.cpp*/ -/* grib_accessor_class_int64.c */ +/* grib_accessor_class_int64.cpp*/ -/* grib_accessor_class_int64_little_endian.c */ +/* grib_accessor_class_int64_little_endian.cpp*/ -/* grib_accessor_class_int8.c */ +/* grib_accessor_class_int8.cpp*/ -/* grib_accessor_class_uint16.c */ +/* grib_accessor_class_uint16.cpp*/ -/* grib_accessor_class_uint16_little_endian.c */ +/* grib_accessor_class_uint16_little_endian.cpp*/ -/* grib_accessor_class_uint32.c */ +/* grib_accessor_class_uint32.cpp*/ -/* grib_accessor_class_uint32_little_endian.c */ +/* grib_accessor_class_uint32_little_endian.cpp*/ -/* grib_accessor_class_uint64.c */ +/* grib_accessor_class_uint64.cpp*/ -/* grib_accessor_class_uint64_little_endian.c */ +/* grib_accessor_class_uint64_little_endian.cpp*/ -/* grib_accessor_class_uint8.c */ +/* grib_accessor_class_uint8.cpp*/ -/* grib_accessor_class_blob.c */ +/* grib_accessor_class_blob.cpp*/ -/* grib_accessor_class_julian_day.c */ +/* grib_accessor_class_julian_day.cpp*/ -/* grib_accessor_class_julian_date.c */ +/* grib_accessor_class_julian_date.cpp*/ -/* grib_accessor_class_latlonvalues.c */ +/* grib_accessor_class_latlonvalues.cpp*/ -/* grib_accessor_class_latitudes.c */ +/* grib_accessor_class_latitudes.cpp*/ -/* grib_accessor_class_longitudes.c */ +/* grib_accessor_class_longitudes.cpp*/ -/* grib_accessor_class_missing.c */ +/* grib_accessor_class_missing.cpp*/ -/* grib_accessor_class_octahedral_gaussian.c */ +/* grib_accessor_class_octahedral_gaussian.cpp*/ -/* grib_accessor_class_offset_file.c */ +/* grib_accessor_class_offset_file.cpp*/ -/* grib_accessor_class_scale.c */ +/* grib_accessor_class_scale.cpp*/ -/* grib_accessor_class_rdbtime_guess_date.c */ +/* grib_accessor_class_rdbtime_guess_date.cpp*/ -/* grib_accessor_class_from_scale_factor_scaled_value.c */ +/* grib_accessor_class_from_scale_factor_scaled_value.cpp*/ -/* grib_accessor_class_times.c */ +/* grib_accessor_class_times.cpp*/ -/* grib_accessor_class_forward.c */ +/* grib_accessor_class_forward.cpp*/ -/* grib_accessor_class_g2bitmap_present.c */ +/* grib_accessor_class_g2bitmap_present.cpp*/ -/* grib_accessor_class_ibmfloat.c */ +/* grib_accessor_class_ibmfloat.cpp*/ -/* grib_accessor_class_ieeefloat.c */ +/* grib_accessor_class_ieeefloat.cpp*/ -/* grib_accessor_class_constant.c */ +/* grib_accessor_class_constant.cpp*/ void accessor_constant_set_type(grib_accessor* a, int type); void accessor_constant_set_dval(grib_accessor* a, double dval); -/* grib_accessor_class_iterator.c */ +/* grib_accessor_class_iterator.cpp*/ grib_iterator* grib_iterator_new(const grib_handle* h, unsigned long flags, int* error); -/* grib_accessor_class_message.c */ +/* grib_accessor_class_message.cpp*/ -/* grib_accessor_class_nearest.c */ +/* grib_accessor_class_nearest.cpp*/ grib_nearest* grib_nearest_new(const grib_handle* h, int* error); -/* grib_accessor_class_ksec1expver.c */ +/* grib_accessor_class_ksec1expver.cpp*/ -/* grib_accessor_class_laplacian.c */ +/* grib_accessor_class_laplacian.cpp*/ -/* grib_accessor_class_label.c */ +/* grib_accessor_class_label.cpp*/ -/* grib_accessor_class_long.c */ +/* grib_accessor_class_long.cpp*/ -/* grib_accessor_class_lookup.c */ +/* grib_accessor_class_lookup.cpp*/ -/* grib_accessor_class_octet_number.c */ +/* grib_accessor_class_octet_number.cpp*/ -/* grib_accessor_class_headers_only.c */ +/* grib_accessor_class_headers_only.cpp*/ -/* grib_accessor_class_padding.c */ +/* grib_accessor_class_padding.cpp*/ -/* grib_accessor_class_pad.c */ +/* grib_accessor_class_pad.cpp*/ -/* grib_accessor_class_padto.c */ +/* grib_accessor_class_padto.cpp*/ -/* grib_accessor_class_padtoeven.c */ +/* grib_accessor_class_padtoeven.cpp*/ -/* grib_accessor_class_padtomultiple.c */ +/* grib_accessor_class_padtomultiple.cpp*/ -/* grib_accessor_class_section_padding.c */ +/* grib_accessor_class_section_padding.cpp*/ -/* grib_accessor_class_section_pointer.c */ +/* grib_accessor_class_section_pointer.cpp*/ -/* grib_accessor_class_position.c */ +/* grib_accessor_class_position.cpp*/ -/* grib_accessor_class_signed.c */ +/* grib_accessor_class_signed.cpp*/ -/* grib_accessor_class_signed_bits.c */ +/* grib_accessor_class_signed_bits.cpp*/ -/* grib_accessor_class_section.c */ +/* grib_accessor_class_section.cpp*/ -/* grib_accessor_class_step_in_units.c */ +/* grib_accessor_class_step_in_units.cpp*/ -/* grib_accessor_class_section_length.c */ +/* grib_accessor_class_section_length.cpp*/ -/* grib_accessor_class_g1_message_length.c */ +/* grib_accessor_class_g1_message_length.cpp*/ int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s4, long* total_length, long* sec4_len); -/* grib_accessor_class_g1_section4_length.c */ +/* grib_accessor_class_g1_section4_length.cpp*/ -/* grib_accessor_class_size.c */ +/* grib_accessor_class_size.cpp*/ -/* grib_accessor_class_scale_values.c */ +/* grib_accessor_class_scale_values.cpp*/ -/* grib_accessor_class_offset_values.c */ +/* grib_accessor_class_offset_values.cpp*/ -/* grib_accessor_class_sprintf.c */ +/* grib_accessor_class_sprintf.cpp*/ -/* grib_accessor_class_getenv.c */ +/* grib_accessor_class_getenv.cpp*/ -/* grib_accessor_class_round.c */ +/* grib_accessor_class_round.cpp*/ -/* grib_accessor_class_spectral_truncation.c */ +/* grib_accessor_class_spectral_truncation.cpp*/ -/* grib_accessor_class_time.c */ +/* grib_accessor_class_time.cpp*/ -/* grib_accessor_class_transient.c */ +/* grib_accessor_class_transient.cpp*/ -/* grib_accessor_class_values.c */ +/* grib_accessor_class_values.cpp*/ -/* grib_accessor_class_simple_packing_error.c */ +/* grib_accessor_class_simple_packing_error.cpp*/ -/* grib_accessor_class_data_simple_packing.c */ +/* grib_accessor_class_data_simple_packing.cpp*/ -/* grib_accessor_class_data_ccsds_packing.c */ +/* grib_accessor_class_data_ccsds_packing.cpp*/ -/* grib_accessor_class_count_missing.c */ +/* grib_accessor_class_count_missing.cpp*/ -/* grib_accessor_class_data_sh_packed.c */ +/* grib_accessor_class_data_sh_packed.cpp*/ -/* grib_accessor_class_data_sh_unpacked.c */ +/* grib_accessor_class_data_sh_unpacked.cpp*/ -/* grib_accessor_class_number_of_values_data_raw_packing.c */ +/* grib_accessor_class_number_of_values_data_raw_packing.cpp*/ -/* grib_accessor_class_data_g1simple_packing.c */ +/* grib_accessor_class_data_g1simple_packing.cpp*/ -/* grib_accessor_class_data_g1shsimple_packing.c */ +/* grib_accessor_class_data_g1shsimple_packing.cpp*/ -/* grib_accessor_class_data_shsimple_packing.c */ +/* grib_accessor_class_data_shsimple_packing.cpp*/ -/* grib_accessor_class_data_dummy_field.c */ +/* grib_accessor_class_data_dummy_field.cpp*/ -/* grib_2order_packer_simple.c */ +/* grib_2order_packer_simple.cpp*/ void grib_free_second_order_groups(grib_context* c, second_order_packed* sp); second_order_packed* grib_get_second_order_groups(grib_context* c, const unsigned long* vals, size_t len); -/* grib_accessor_class_variable.c */ +/* grib_accessor_class_variable.cpp*/ void accessor_variable_set_type(grib_accessor* a, int type); -/* grib_accessor_class_second_order_bits_per_value.c */ +/* grib_accessor_class_second_order_bits_per_value.cpp*/ -/* grib_accessor_class_data_g2simple_packing.c */ +/* grib_accessor_class_data_g2simple_packing.cpp*/ -/* grib_accessor_class_data_g2simple_packing_with_preprocessing.c */ +/* grib_accessor_class_data_g2simple_packing_with_preprocessing.cpp*/ -/* grib_accessor_class_data_g2shsimple_packing.c */ +/* grib_accessor_class_data_g2shsimple_packing.cpp*/ -/* grib_accessor_class_data_g2complex_packing.c */ +/* grib_accessor_class_data_g2complex_packing.cpp*/ -/* grib_accessor_class_data_2order_packing.c */ +/* grib_accessor_class_data_2order_packing.cpp*/ -/* grib_accessor_class_data_g1second_order_row_by_row_packing.c */ +/* grib_accessor_class_data_g1second_order_row_by_row_packing.cpp*/ -/* grib_accessor_class_data_g1second_order_constant_width_packing.c */ +/* grib_accessor_class_data_g1second_order_constant_width_packing.cpp*/ -/* grib_accessor_class_data_g1second_order_general_packing.c */ +/* grib_accessor_class_data_g1second_order_general_packing.cpp*/ -/* grib_accessor_class_data_g1second_order_general_extended_packing.c */ +/* grib_accessor_class_data_g1second_order_general_extended_packing.cpp*/ -/* grib_accessor_class_g2grid.c */ +/* grib_accessor_class_g2grid.cpp*/ -/* grib_accessor_class_unexpanded_descriptors.c */ +/* grib_accessor_class_unexpanded_descriptors.cpp*/ -/* grib_accessor_class_expanded_descriptors.c */ +/* grib_accessor_class_expanded_descriptors.cpp*/ int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a, long do_expand); bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a, int* err); -/* grib_accessor_class_bufrdc_expanded_descriptors.c */ +/* grib_accessor_class_bufrdc_expanded_descriptors.cpp*/ -/* grib_accessor_class_data_apply_bitmap.c */ +/* grib_accessor_class_data_apply_bitmap.cpp*/ -/* grib_accessor_class_data_apply_boustrophedonic.c */ +/* grib_accessor_class_data_apply_boustrophedonic.cpp*/ -/* grib_accessor_class_data_apply_boustrophedonic_bitmap.c */ +/* grib_accessor_class_data_apply_boustrophedonic_bitmap.cpp*/ -/* grib_accessor_class_data_secondary_bitmap.c */ +/* grib_accessor_class_data_secondary_bitmap.cpp*/ -/* grib_accessor_class_data_g1secondary_bitmap.c */ +/* grib_accessor_class_data_g1secondary_bitmap.cpp*/ -/* grib_accessor_class_data_g2secondary_bitmap.c */ +/* grib_accessor_class_data_g2secondary_bitmap.cpp*/ -/* grib_accessor_class_data_jpeg2000_packing.c */ +/* grib_accessor_class_data_jpeg2000_packing.cpp*/ -/* grib_accessor_class_data_png_packing.c */ +/* grib_accessor_class_data_png_packing.cpp*/ -/* grib_accessor_class_data_raw_packing.c */ +/* grib_accessor_class_data_raw_packing.cpp*/ -/* grib_accessor_class_data_complex_packing.c */ +/* grib_accessor_class_data_complex_packing.cpp*/ -/* grib_accessor_class_data_g1complex_packing.c */ +/* grib_accessor_class_data_g1complex_packing.cpp*/ -/* grib_accessor_class_gds_not_present_bitmap.c */ +/* grib_accessor_class_gds_not_present_bitmap.cpp*/ -/* grib_accessor_class_data_apply_gdsnotpresent.c */ +/* grib_accessor_class_data_apply_gdsnotpresent.cpp*/ -/* grib_accessor_class_gds_is_present.c */ +/* grib_accessor_class_gds_is_present.cpp*/ -/* grib_accessor_class_select_step_template.c */ +/* grib_accessor_class_select_step_template.cpp*/ -/* grib_accessor_class_local_definition.c */ +/* grib_accessor_class_local_definition.cpp*/ -/* grib_accessor_class_g2_eps.c */ +/* grib_accessor_class_g2_eps.cpp*/ -/* grib_accessor_class_g2_aerosol.c */ +/* grib_accessor_class_g2_aerosol.cpp*/ -/* grib_accessor_class_g2_chemical.c */ +/* grib_accessor_class_g2_chemical.cpp*/ -/* grib_accessor_class_g2_mars_labeling.c */ +/* grib_accessor_class_g2_mars_labeling.cpp*/ -/* grib_accessor_class_transient_darray.c */ +/* grib_accessor_class_transient_darray.cpp*/ -/* grib_accessor_class_md5.c */ +/* grib_accessor_class_md5.cpp*/ -/* grib_jasper_encoding.c */ +/* grib_jasper_encoding.cpp*/ int grib_jasper_decode(grib_context* c, unsigned char* buf, const size_t* buflen, double* values, const size_t* n_vals); int grib_jasper_encode(grib_context* c, j2k_encode_helper* helper); -/* grib_openjpeg_encoding.c */ +/* grib_openjpeg_encoding.cpp*/ int grib_openjpeg_decode(grib_context* c, unsigned char* buf, const size_t* buflen, double* values, const size_t* n_vals); int grib_openjpeg_encode(grib_context* c, j2k_encode_helper* helper); -/* action_class_set_missing.c */ +/* action_class_set_missing.cpp*/ grib_action* grib_action_create_set_missing(grib_context* context, const char* name); -/* grib_accessor_class_number_of_points.c */ +/* grib_accessor_class_number_of_points.cpp*/ -/* grib_accessor_class_suppressed.c */ +/* grib_accessor_class_suppressed.cpp*/ -/* grib_index.c */ +/* grib_index.cpp*/ int grib_index_compress(grib_index* index); int grib_read_uchar(FILE* fh, unsigned char* val); int grib_read_short(FILE* fh, short* val); @@ -729,66 +729,66 @@ int codes_index_set_product_kind(grib_index* index, ProductKind product_kind); int codes_index_set_unpack_bufr(grib_index* index, int unpack); int is_index_file(const char* filename); -/* grib_accessor_class_number_of_points_gaussian.c */ +/* grib_accessor_class_number_of_points_gaussian.cpp*/ -/* grib_accessor_class_number_of_values.c */ +/* grib_accessor_class_number_of_values.cpp*/ -/* grib_accessor_class_number_of_coded_values.c */ +/* grib_accessor_class_number_of_coded_values.cpp*/ -/* grib_accessor_class_g1number_of_coded_values_sh_complex.c */ +/* grib_accessor_class_g1number_of_coded_values_sh_complex.cpp*/ -/* grib_accessor_class_g1number_of_coded_values_sh_simple.c */ +/* grib_accessor_class_g1number_of_coded_values_sh_simple.cpp*/ -/* grib_accessor_class_dirty.c */ +/* grib_accessor_class_dirty.cpp*/ -/* grib_accessor_class_statistics.c */ +/* grib_accessor_class_statistics.cpp*/ -/* grib_accessor_class_statistics_spectral.c */ +/* grib_accessor_class_statistics_spectral.cpp*/ -/* grib_accessor_class_unsigned.c */ +/* grib_accessor_class_unsigned.cpp*/ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, int check); -/* grib_accessor_class_unsigned_bits.c */ +/* grib_accessor_class_unsigned_bits.cpp*/ -/* grib_accessor_class_raw.c */ +/* grib_accessor_class_raw.cpp*/ void accessor_raw_set_length(grib_accessor* a, size_t len); long accessor_raw_get_offset(grib_accessor* a); -/* grib_accessor_class_bufr_extract_subsets.c */ +/* grib_accessor_class_bufr_extract_subsets.cpp*/ -/* grib_accessor_class_bufr_simple_thinning.c */ +/* grib_accessor_class_bufr_simple_thinning.cpp*/ -/* grib_accessor_class_spd.c */ +/* grib_accessor_class_spd.cpp*/ -/* grib_accessor_class_sum.c */ +/* grib_accessor_class_sum.cpp*/ -/* grib_accessor_class_to_integer.c */ +/* grib_accessor_class_to_integer.cpp*/ -/* grib_accessor_class_to_double.c */ +/* grib_accessor_class_to_double.cpp*/ -/* grib_accessor_class_to_string.c */ +/* grib_accessor_class_to_string.cpp*/ -/* grib_accessor_class_sexagesimal2decimal.c */ +/* grib_accessor_class_sexagesimal2decimal.cpp*/ -/* grib_accessor_class_vector.c */ +/* grib_accessor_class_vector.cpp*/ -/* grib_accessor_class_long_vector.c */ +/* grib_accessor_class_long_vector.cpp*/ -/* grib_gaussian_reduced.c */ +/* grib_gaussian_reduced.cpp*/ void grib_get_reduced_row_wrapper(grib_handle* h, long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); void grib_get_reduced_row_legacy(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); void grib_get_reduced_row(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last); void grib_get_reduced_row_p(long pl, double lon_first, double lon_last, long* npoints, double* olon_first, double* olon_last); -/* grib_accessor_class_abstract_vector.c */ +/* grib_accessor_class_abstract_vector.cpp*/ -/* grib_accessor_class_abstract_long_vector.c */ +/* grib_accessor_class_abstract_long_vector.cpp*/ -/* grib_loader_from_handle.c */ +/* grib_loader_from_handle.cpp*/ int grib_lookup_long_from_handle(grib_context* gc, grib_loader* loader, const char* name, long* value); int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_arguments* default_value); -/* grib_bits.c */ +/* grib_bits.cpp*/ unsigned long grib_decode_unsigned_byte_long(const unsigned char* p, long o, int l); long grib_decode_signed_long(const unsigned char* p, long o, int l); int grib_encode_signed_long(unsigned char* p, long val, long o, int l); @@ -798,7 +798,7 @@ void grib_set_bit(unsigned char* p, long bitp, int val); long grib_decode_signed_longb(const unsigned char* p, long* bitp, long nbits); int grib_encode_signed_longb(unsigned char* p, long val, long* bitp, long nb); -/* grib_timer.c */ +/* grib_timer.cpp*/ double proc_cpu(void); char* timename(double t); grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statname, int elapsed); @@ -811,7 +811,7 @@ void grib_timer_partial_rate(grib_timer* t, double start, long total); void grib_print_all_timers(void); void grib_reset_all_timers(void); -/* grib_ibmfloat.c */ +/* grib_ibmfloat.cpp*/ unsigned long grib_ibm_to_long(double x); double grib_ibmfloat_error(double x); double grib_long_to_ibm(unsigned long x); @@ -820,7 +820,7 @@ double grib_ibm_table_v(unsigned long e); unsigned long grib_ibm_nearest_smaller_to_long(double x); int grib_nearest_smaller_ibm_float(double a, double* ret); -/* grib_ieeefloat.c */ +/* grib_ieeefloat.cpp*/ double grib_ieee_table_e(unsigned long e); double grib_ieee_table_v(unsigned long e); unsigned long grib_ieee_to_long(double x); @@ -834,9 +834,9 @@ double grib_long_to_ieee64(unsigned long x); int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val); int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, unsigned char* buf); -/* grib_accessor_class_reference_value_error.c */ +/* grib_accessor_class_reference_value_error.cpp*/ -/* grib_memory.c */ +/* grib_memory.cpp*/ void* grib_transient_malloc(const grib_context* c, size_t s); void* grib_transient_realloc(const grib_context* c, void* p, size_t s); void grib_transient_free(const grib_context* c, void* p); @@ -847,7 +847,7 @@ void* grib_buffer_malloc(const grib_context* c, size_t s); void grib_buffer_free(const grib_context* c, void* p); void* grib_buffer_realloc(const grib_context* c, void* p, size_t s); -/* grib_buffer.c */ +/* grib_buffer.cpp*/ void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b); grib_buffer* grib_create_growable_buffer(const grib_context* c); grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, size_t buflen); @@ -859,7 +859,7 @@ void grib_recompute_sections_lengths(grib_section* s); void grib_buffer_replace(grib_accessor* a, const unsigned char* data, size_t newsize, int update_lengths, int update_paddings); void grib_update_sections_lengths(grib_handle* h); -/* grib_dumper.c */ +/* grib_dumper.cpp*/ void grib_init_dumper(grib_dumper* d); void grib_dumper_delete(grib_dumper* d); void grib_dump_long(grib_dumper* d, grib_accessor* a, const char* comment); @@ -874,39 +874,39 @@ void grib_dump_values(grib_dumper* d, grib_accessor* a); void grib_dump_header(grib_dumper* d, const grib_handle* h); void grib_dump_footer(grib_dumper* d, const grib_handle* h); -/* grib_dumper_class_serialize.c */ +/* grib_dumper_class_serialize.cpp*/ -/* grib_dumper_class_debug.c */ +/* grib_dumper_class_debug.cpp*/ -/* grib_dumper_class_default.c */ +/* grib_dumper_class_default.cpp*/ -/* grib_dumper_class_keys.c */ +/* grib_dumper_class_keys.cpp*/ -/* grib_dumper_class_bufr_encode_C.c */ +/* grib_dumper_class_bufr_encode_C.cpp*/ -/* grib_dumper_class_bufr_encode_filter.c */ +/* grib_dumper_class_bufr_encode_filter.cpp*/ -/* grib_dumper_class_bufr_encode_fortran.c */ +/* grib_dumper_class_bufr_encode_fortran.cpp*/ -/* grib_dumper_class_bufr_encode_python.c */ +/* grib_dumper_class_bufr_encode_python.cpp*/ -/* grib_dumper_class_bufr_decode_C.c */ +/* grib_dumper_class_bufr_decode_C.cpp*/ -/* grib_dumper_class_bufr_decode_filter.c */ +/* grib_dumper_class_bufr_decode_filter.cpp*/ -/* grib_dumper_class_bufr_decode_fortran.c */ +/* grib_dumper_class_bufr_decode_fortran.cpp*/ -/* grib_dumper_class_bufr_decode_python.c */ +/* grib_dumper_class_bufr_decode_python.cpp*/ -/* grib_dumper_class_bufr_simple.c */ +/* grib_dumper_class_bufr_simple.cpp*/ -/* grib_dumper_class_json.c */ +/* grib_dumper_class_json.cpp*/ -/* grib_dumper_class_grib_encode_C.c */ +/* grib_dumper_class_grib_encode_C.cpp*/ -/* grib_dumper_class_wmo.c */ +/* grib_dumper_class_wmo.cpp*/ -/* grib_dumper_class.c */ +/* grib_dumper_class.cpp*/ grib_dumper* grib_dumper_factory(const char* op, const grib_handle* h, FILE* out, unsigned long option_flags, void* arg); void grib_dump_accessors_block(grib_dumper* dumper, grib_block_of_accessors* block); void grib_dump_accessors_list(grib_dumper* dumper, grib_accessors_list* al); @@ -916,7 +916,7 @@ void grib_dump_keys(grib_handle* h, FILE* f, const char* mode, unsigned long fla grib_dumper* grib_dump_content_with_dumper(grib_handle* h, grib_dumper* dumper, FILE* f, const char* mode, unsigned long flags, void* data); void codes_dump_bufr_flat(grib_accessors_list* al, grib_handle* h, FILE* f, const char* mode, unsigned long flags, void* data); -/* grib_context.c */ +/* grib_context.cpp*/ size_t grib_context_read(const grib_context* c, void* ptr, size_t size, void* stream); off_t grib_context_tell(const grib_context* c, void* stream); int grib_context_seek(const grib_context* c, off_t offset, int whence, void* stream); @@ -976,14 +976,14 @@ void grib_gts_header_off(grib_context* c); void grib_multi_support_on(grib_context* c); void grib_multi_support_off(grib_context* c); -/* grib_date.c */ +/* grib_date.cpp*/ int grib_julian_to_datetime(double jd, long* year, long* month, long* day, long* hour, long* minute, long* second); int grib_datetime_to_julian(long year, long month, long day, long hour, long minute, long second, double* jd); int grib_datetime_to_julian_d(long year, long month, long day, long hour, long minute, double second, double* jd); long grib_julian_to_date(long jdate); long grib_date_to_julian(long ddate); -/* grib_fieldset.c */ +/* grib_fieldset.cpp*/ int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type); grib_fieldset* grib_fieldset_new_from_files(grib_context* c, const char* filenames[], int nfiles, const char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err); int grib_fieldset_apply_where(grib_fieldset* set, const char* where_string); @@ -996,7 +996,7 @@ grib_handle* grib_fieldset_next_handle(grib_fieldset* set, int* err); int grib_fieldset_count(const grib_fieldset* set); grib_handle* grib_fieldset_retrieve(grib_fieldset* set, int i, int* err); -/* grib_filepool.c */ +/* grib_filepool.cpp*/ void grib_file_pool_clean(void); grib_file* grib_file_pool_get_files(void); int grib_file_pool_read(grib_context* c, FILE* fh); @@ -1010,7 +1010,7 @@ grib_file* grib_find_file(short id); grib_file* grib_file_new(grib_context* c, const char* name, int* err); void grib_file_delete(grib_file* file); -/* grib_geography.c */ +/* grib_geography.cpp*/ int grib_get_gaussian_latitudes(long trunc, double* lats); int is_gaussian_global(double lat1, double lat2, double lon1, double lon2, long num_points_equator, const double* latitudes, double angular_precision); void rotate(const double inlat, const double inlon, const double angleOfRot, const double southPoleLat, const double southPoleLon, double* outlat, double* outlon); @@ -1018,7 +1018,7 @@ void unrotate(const double inlat, const double inlon, const double angleOfRot, c double geographic_distance_spherical(double radius, double lon1, double lat1, double lon2, double lat2); double geographic_distance_ellipsoid(double major, double minor, double lon1, double lat1, double lon2, double lat2); -/* grib_handle.c */ +/* grib_handle.cpp*/ grib_section* grib_section_create(grib_handle* h, grib_accessor* owner); void grib_swap_sections(grib_section* the_old, grib_section* the_new); void grib_empty_section(grib_context* c, grib_section* b); @@ -1068,20 +1068,20 @@ int grib_handle_prepare_action(grib_handle* h, grib_action* a); void grib_multi_support_reset_file(grib_context* c, FILE* f); void grib_multi_support_reset(grib_context* c); -/* grib_header_compute.c */ +/* grib_header_compute.cpp*/ void print_math(grib_math* m); grib_math* grib_math_clone(grib_context* c, grib_math* m); void grib_math_delete(grib_context* c, grib_math* m); grib_math* grib_math_new(grib_context* c, const char* formula, int* err); -/* grib_hash_keys.c */ +/* grib_hash_keys.cpp*/ const struct grib_keys_hash* grib_keys_hash_get(const char *str, size_t len); grib_itrie* grib_hash_keys_new(grib_context* c, int* count); void grib_hash_keys_delete(grib_itrie* t); int grib_hash_keys_get_id(grib_itrie* t, const char* key); int grib_hash_keys_get_size(grib_itrie* t); -/* grib_io.c */ +/* grib_io.cpp*/ off_t stdio_tell(void* data); int stdio_seek(void* data, off_t len); int stdio_seek_from_start(void* data, off_t len); @@ -1109,7 +1109,7 @@ int grib_count_in_filename(grib_context* c, const char* filename, int* n); int codes_extract_offsets_malloc(grib_context* c, const char* filename, ProductKind product, off_t** offsets, int* length, int strict_mode); -/* grib_trie.c */ +/* grib_trie.cpp*/ grib_trie* grib_trie_new(grib_context* c); void grib_trie_delete_container(grib_trie* t); void grib_trie_delete(grib_trie* t); @@ -1118,24 +1118,24 @@ void* grib_trie_insert(grib_trie* t, const char* key, void* data); void* grib_trie_insert_no_replace(grib_trie* t, const char* key, void* data); void* grib_trie_get(grib_trie* t, const char* key); -/* grib_trie_with_rank.c */ +/* grib_trie_with_rank.cpp*/ grib_trie_with_rank* grib_trie_with_rank_new(grib_context* c); void grib_trie_with_rank_delete_container(grib_trie_with_rank* t); int grib_trie_with_rank_insert(grib_trie_with_rank* t, const char* key, void* data); void* grib_trie_with_rank_get(grib_trie_with_rank* t, const char* key, int rank); -/* grib_itrie.c */ +/* grib_itrie.cpp*/ grib_itrie* grib_itrie_new(grib_context* c, int* count); void grib_itrie_delete(grib_itrie* t); int grib_itrie_get_id(grib_itrie* t, const char* key); int grib_itrie_insert(grib_itrie* t, const char* key); int grib_itrie_get_size(grib_itrie* t); -/* grib_rules.c */ +/* grib_rules.cpp*/ grib_rule_entry* grib_new_rule_entry(grib_context* c, const char* name, grib_expression* expression); grib_rule* grib_new_rule(grib_context* c, grib_expression* condition, grib_rule_entry* entries); -/* grib_keys_iterator.c */ +/* grib_keys_iterator.cpp*/ grib_keys_iterator* grib_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space); int grib_keys_iterator_set_flags(grib_keys_iterator* ki, unsigned long flags); int grib_keys_iterator_rewind(grib_keys_iterator* ki); @@ -1149,7 +1149,7 @@ int grib_keys_iterator_get_string(const grib_keys_iterator* kiter, char* v, size int grib_keys_iterator_get_bytes(const grib_keys_iterator* kiter, unsigned char* v, size_t* len); int grib_keys_iterator_get_native_type(const grib_keys_iterator* kiter); -/* bufr_keys_iterator.c */ +/* bufr_keys_iterator.cpp*/ bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags); bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h); int codes_bufr_keys_iterator_rewind(bufr_keys_iterator* ki); @@ -1158,7 +1158,7 @@ char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* kiter); grib_accessor* codes_bufr_keys_iterator_get_accessor(bufr_keys_iterator* kiter); int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter); -/* grib_parse_utils.c */ +/* grib_parse_utils.cpp*/ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* uname, char* fname, int fail); int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const char* name, int type, const char* format, const char* separator, int maxcols, int* newline, FILE* out); int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* uname, int fail, FILE* out); @@ -1173,24 +1173,24 @@ grib_rule* grib_parse_rules_file(grib_context* gc, const char* filename); grib_action* grib_parse_file(grib_context* gc, const char* filename); int grib_type_to_int(char id); -/* grib_query.c */ +/* grib_query.cpp*/ grib_accessors_list* grib_find_accessors_list(const grib_handle* h, const char* name); char* grib_split_name_attribute(grib_context* c, const char* name, char* attribute_name); grib_accessor* grib_find_accessor(const grib_handle* h, const char* name); grib_accessor* grib_find_attribute(grib_handle* h, const char* name, const char* attr_name, int* err); grib_accessor* grib_find_accessor_fast(grib_handle* h, const char* name); -/* grib_scaling.c */ +/* grib_scaling.cpp*/ double grib_power(long s, long n); long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret); long grib_get_bits_per_value(double max, double min, long binary_scale_factor); long grib_get_decimal_scale_fact(double max, double min, long bpval, long binary_scale); -/* grib_templates.c */ +/* grib_templates.cpp*/ grib_handle* codes_external_template(grib_context* c, ProductKind product_kind, const char* name); char* get_external_template_path(grib_context* c, const char* name); -/* grib_dependency.c */ +/* grib_dependency.cpp*/ grib_handle* grib_handle_of_accessor(const grib_accessor* a); void grib_dependency_add(grib_accessor* observer, grib_accessor* observed); void grib_dependency_remove_observed(grib_accessor* observed); @@ -1200,7 +1200,7 @@ void grib_dependency_remove_observer(grib_accessor* observer); void grib_dependency_observe_expression(grib_accessor* observer, grib_expression* e); void grib_dependency_observe_arguments(grib_accessor* observer, grib_arguments* a); -/* grib_value.c */ +/* grib_value.cpp*/ int grib_set_expression(grib_handle* h, const char* name, grib_expression* e); int grib_set_expression_internal(grib_handle* h, const char* name, grib_expression* e); int grib_set_long_internal(grib_handle* h, const char* name, long val); @@ -1272,68 +1272,68 @@ int grib_values_check(grib_handle* h, grib_values* values, int count); int grib_key_equal(grib_handle* h1, grib_handle* h2, const char* key, int type, int* err); int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type); -/* grib_errors.c */ +/* grib_errors.cpp*/ const char* grib_get_error_message(int code); void grib_check(const char* call, const char* file, int line, int e, const char* msg); -/* grib_expression_class_binop.c */ +/* grib_expression_class_binop.cpp*/ grib_expression* new_binop_expression(grib_context* c, grib_binop_long_proc long_func, grib_binop_double_proc double_func, grib_expression* left, grib_expression* right); -/* grib_expression_class_logical_and.c */ +/* grib_expression_class_logical_and.cpp*/ grib_expression* new_logical_and_expression(grib_context* c, grib_expression* left, grib_expression* right); -/* grib_expression_class_logical_or.c */ +/* grib_expression_class_logical_or.cpp*/ grib_expression* new_logical_or_expression(grib_context* c, grib_expression* left, grib_expression* right); -/* grib_expression_class_is_in_dict.c */ +/* grib_expression_class_is_in_dict.cpp*/ grib_expression* new_is_in_dict_expression(grib_context* c, const char* name, const char* list); -/* grib_expression_class_true.c */ +/* grib_expression_class_true.cpp*/ grib_expression* new_true_expression(grib_context* c); -/* grib_expression_class_string_compare.c */ +/* grib_expression_class_string_compare.cpp*/ grib_expression* new_string_compare_expression(grib_context* c, grib_expression* left, grib_expression* right); -/* grib_expression_class_unop.c */ +/* grib_expression_class_unop.cpp*/ grib_expression* new_unop_expression(grib_context* c, grib_unop_long_proc long_func, grib_unop_double_proc double_func, grib_expression* exp); -/* grib_expression_class_functor.c */ +/* grib_expression_class_functor.cpp*/ grib_expression* new_func_expression(grib_context* c, const char* name, grib_arguments* args); -/* grib_expression_class_accessor.c */ +/* grib_expression_class_accessor.cpp*/ grib_expression* new_accessor_expression(grib_context* c, const char* name, long start, size_t length); -/* grib_expression_class_is_in_list.c */ +/* grib_expression_class_is_in_list.cpp*/ grib_expression* new_is_in_list_expression(grib_context* c, const char* name, const char* list); -/* grib_expression_class_is_integer.c */ +/* grib_expression_class_is_integer.cpp*/ grib_expression* new_is_integer_expression(grib_context* c, const char* name, int start, int length); -/* grib_expression_class_length.c */ +/* grib_expression_class_length.cpp*/ grib_expression* new_length_expression(grib_context* c, const char* name); -/* grib_expression_class_long.c */ +/* grib_expression_class_long.cpp*/ grib_expression* new_long_expression(grib_context* c, long value); -/* grib_expression_class_double.c */ +/* grib_expression_class_double.cpp*/ grib_expression* new_double_expression(grib_context* c, double value); -/* grib_expression_class_string.c */ +/* grib_expression_class_string.cpp*/ grib_expression* new_string_expression(grib_context* c, const char* value); -/* grib_expression_class_sub_string.c */ +/* grib_expression_class_sub_string.cpp*/ grib_expression* new_sub_string_expression(grib_context* c, const char* value, size_t start, size_t length); -/* grib_box.c */ +/* grib_box.cpp*/ int grib_box_init(grib_box* box, grib_handle* h, grib_arguments* args); void grib_points_delete(grib_points* points); -/* grib_box_class.c */ +/* grib_box_class.cpp*/ grib_box* grib_box_factory(grib_handle* h, grib_arguments* args); -/* grib_box_class_gen.c */ +/* grib_box_class_gen.cpp*/ -/* grib_nearest.c */ +/* grib_nearest.cpp*/ int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); int grib_nearest_init(grib_nearest* i, grib_handle* h, grib_arguments* args); int grib_nearest_delete(grib_nearest* i); @@ -1349,30 +1349,30 @@ int grib_nearest_find_generic(grib_nearest* nearest, grib_handle* h, double inla double** out_distances, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); -/* grib_nearest_class.c */ +/* grib_nearest_class.cpp*/ grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args); -/* grib_nearest_class_gen.c */ +/* grib_nearest_class_gen.cpp*/ -/* grib_nearest_class_regular.c */ +/* grib_nearest_class_regular.cpp*/ -/* grib_nearest_class_reduced.c */ +/* grib_nearest_class_reduced.cpp*/ -/* grib_nearest_class_latlon_reduced.c */ +/* grib_nearest_class_latlon_reduced.cpp*/ -/* grib_nearest_class_sh.c */ +/* grib_nearest_class_sh.cpp*/ -/* grib_nearest_class_lambert_conformal.c */ +/* grib_nearest_class_lambert_conformal.cpp*/ -/* grib_nearest_class_polar_stereographic.c */ +/* grib_nearest_class_polar_stereographic.cpp*/ -/* grib_iterator_class_polar_stereographic.c */ +/* grib_iterator_class_polar_stereographic.cpp*/ -/* grib_iterator_class_lambert_azimuthal_equal_area.c */ +/* grib_iterator_class_lambert_azimuthal_equal_area.cpp*/ -/* grib_iterator_class_lambert_conformal.c */ +/* grib_iterator_class_lambert_conformal.cpp*/ -/* grib_iterator.c */ +/* grib_iterator.cpp*/ int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values); int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value); int grib_iterator_has_next(grib_iterator* i); @@ -1381,25 +1381,25 @@ int grib_iterator_reset(grib_iterator* i); int grib_iterator_init(grib_iterator* i, grib_handle* h, grib_arguments* args); int grib_iterator_delete(grib_iterator* i); -/* grib_iterator_class.c */ +/* grib_iterator_class.cpp*/ grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* ret); -/* grib_iterator_class_gaussian.c */ +/* grib_iterator_class_gaussian.cpp*/ -/* grib_iterator_class_gaussian_reduced.c */ +/* grib_iterator_class_gaussian_reduced.cpp*/ -/* grib_iterator_class_latlon_reduced.c */ +/* grib_iterator_class_latlon_reduced.cpp*/ -/* grib_iterator_class_gen.c */ +/* grib_iterator_class_gen.cpp*/ int transform_iterator_data(grib_context* c, double* data, long iScansNegatively, long jScansPositively, long jPointsAreConsecutive, long alternativeRowScanning, size_t numPoints, long nx, long ny); -/* grib_iterator_class_latlon.c */ +/* grib_iterator_class_latlon.cpp*/ -/* grib_iterator_class_regular.c */ +/* grib_iterator_class_regular.cpp*/ -/* grib_iterator_class_space_view.c */ +/* grib_iterator_class_space_view.cpp*/ -/* grib_expression.c */ +/* grib_expression.cpp*/ int grib_expression_native_type(grib_handle* h, grib_expression* g); int grib_expression_evaluate_long(grib_handle* h, grib_expression* g, long* result); int grib_expression_evaluate_double(grib_handle* h, grib_expression* g, double* result); @@ -1419,7 +1419,7 @@ double grib_arguments_get_double(grib_handle* h, grib_arguments* args, int n); grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* args, int n); int grib_arguments_get_count(grib_arguments* args); -/* codes_util.c */ +/* codes_util.cpp*/ double normalise_longitude_in_degrees(double lon); char get_dir_separator_char(void); int path_is_regular_file(const char* path); @@ -1428,7 +1428,7 @@ char* codes_getenv(const char* name); int codes_check_grib_ieee_packing_value(int value); int codes_flush_sync_close_file(FILE* f); -/* grib_util.c */ +/* grib_util.cpp*/ grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err); grib_string_list* grib_util_get_param_id(const char* mars_param); grib_string_list* grib_util_get_mars_param(const char* param_id); @@ -1449,7 +1449,7 @@ int grib_check_data_values_range(grib_handle* h, const double min_val, const dou int grib_producing_large_constant_fields(grib_handle* h, int edition); int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val); -/* bufr_util.c */ +/* bufr_util.cpp*/ int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* key); char** codes_bufr_copy_data_return_copied_keys(grib_handle* hin, grib_handle* hout, size_t* nkeys, int* err); int codes_bufr_copy_data(grib_handle* hin, grib_handle* hout); @@ -1457,7 +1457,7 @@ int codes_bufr_extract_headers_malloc(grib_context* c, const char* filename, cod int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* val, size_t* len); int codes_bufr_key_is_header(const grib_handle* h, const char* key, int* err); -/* string_util.c */ +/* string_util.cpp*/ int strcmp_nocase(const char* s1, const char* s2); void string_rtrim(char* s); void string_lrtrim(char** x, int do_left, int do_right); @@ -1471,7 +1471,7 @@ const char* grib_get_type_name(int type); char* string_replace_char(char *str, char oldc, char newc); void string_remove_char(char * str, char c); -/* functions.c */ +/* functions.cpp*/ long grib_op_eq(long a, long b); long grib_op_ne(long a, long b); long grib_op_lt(long a, long b); @@ -1502,20 +1502,20 @@ double grib_op_gt_d(double a, double b); double grib_op_ge_d(double a, double b); double grib_op_le_d(double a, double b); -/* codes_memfs.c */ +/* codes_memfs.cpp*/ FILE* codes_fopen(const char* name, const char* mode); int codes_access(const char* name, int mode); -/* grib_accessor_class_data_g2bifourier_packing.c */ +/* grib_accessor_class_data_g2bifourier_packing.cpp*/ -/* grib_optimize_decimal_factor.c */ +/* grib_optimize_decimal_factor.cpp*/ int grib_optimize_decimal_factor(grib_accessor* a, const char* reference_value, const double pmax, const double pmin, const int knbit, const int compat_gribex, const int compat_32bit, long* kdec, long* kbin, double* ref); -/* grib_api_version.c */ +/* grib_api_version.cpp*/ const char* grib_get_git_sha1(void); const char* codes_get_build_date(void); -/* grib_bits_any_endian.c */ +/* grib_bits_any_endian.cpp*/ int grib_is_all_bits_one(int64_t val, long nbits); int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, const char* string); char* grib_decode_string(const unsigned char* bitStream, long* bitOffset, size_t numberOfCharacters, char* string); @@ -1526,7 +1526,7 @@ int grib_encode_unsigned_longb(unsigned char* p, unsigned long val, long* bitp, int grib_encode_size_tb(unsigned char* p, size_t val, long* bitp, long nb); -/* grib_bits_any_endian_simple.c */ +/* grib_bits_any_endian_simple.cpp*/ int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, size_t n_vals, long* val); int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, double* val); int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val); From 0579ed8e82c39b1aeb561bf34c0a32223713700f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 28 Jan 2023 22:28:34 +0000 Subject: [PATCH 029/212] ECC-1508: Lex and Yacc rules --- src/makeyacc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/makeyacc b/src/makeyacc index 14f8525ce..7dcceefcf 100755 --- a/src/makeyacc +++ b/src/makeyacc @@ -1,18 +1,19 @@ set -xe export LEX=flex -export LEX_OUT=gribl.c -$LEX -o gribl.c gribl.l -sed 's/yy/grib_yy/g' < $LEX_OUT | sed 's/static void grib_yyunput/void grib_yyunput/' > grib_lex1.c -sed 's/fgetc/getc/g' < grib_lex1.c > grib_lex.c -rm -f grib_lex1.c +export LEX_OUT=gribl.cpp +$LEX -o gribl.cpp gribl.l +sed 's/yy/grib_yy/g' < $LEX_OUT | sed 's/static void grib_yyunput/void grib_yyunput/' > grib_lex1.cpp +sed 's/fgetc/getc/g' < grib_lex1.cpp > grib_lex.cpp +rm -f grib_lex1.cpp rm -f $LEX_OUT # This invokes bison yacc -v -d griby.y -sed 's/yy/grib_yy/g' < y.tab.c > grib_yacc1.c -sed 's/fgetc/getc/g' < grib_yacc1.c > grib_yacc.c -rm -f grib_yacc1.c +# This creates y.tab.h and y.tab.c +sed 's/yy/grib_yy/g' < y.tab.c > grib_yacc1.cpp +sed 's/fgetc/getc/g' < grib_yacc1.cpp > grib_yacc.cpp +rm -f grib_yacc1.cpp sed 's/yy/grib_yy/g' < y.tab.h > grib_yacc.h rm -f y.tab.c y.tab.h From 7e9ec112700d53e925abab720c9d53add6c30462 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 12:19:11 +0000 Subject: [PATCH 030/212] ECC-1518: grib_to_netcdf: Error 'Cannot get stepUnits as string' --- definitions/grib2/template.4.93.def | 7 +++++++ definitions/grib2/template.4.94.def | 6 ++++++ definitions/grib2/template.4.95.def | 6 ++++++ definitions/grib2/template.4.96.def | 6 ++++++ definitions/grib2/template.4.97.def | 6 ++++++ definitions/grib2/template.4.98.def | 6 ++++++ definitions/grib2/template.4.localtime.def | 9 +++++++++ 7 files changed, 46 insertions(+) diff --git a/definitions/grib2/template.4.93.def b/definitions/grib2/template.4.93.def index ba14d95d4..8cb8a79bb 100644 --- a/definitions/grib2/template.4.93.def +++ b/definitions/grib2/template.4.93.def @@ -5,7 +5,14 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" + +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits=stepUnits; + #include "grib2/template.4.forecast_time.def" + #include "grib2/template.4.point_in_time.def" include "grib2/template.4.horizontal.def" include "grib2/template.4.localtime.def" diff --git a/definitions/grib2/template.4.94.def b/definitions/grib2/template.4.94.def index 0ba58bb53..ff905d66a 100644 --- a/definitions/grib2/template.4.94.def +++ b/definitions/grib2/template.4.94.def @@ -5,7 +5,13 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" + +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" + #include "grib2/template.4.point_in_time.def" include "grib2/template.4.horizontal.def" include "grib2/template.4.eps.def" diff --git a/definitions/grib2/template.4.95.def b/definitions/grib2/template.4.95.def index 53d2aef4e..e66a1d64d 100644 --- a/definitions/grib2/template.4.95.def +++ b/definitions/grib2/template.4.95.def @@ -4,7 +4,13 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.generating_process.def" + +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits=stepUnits; # no template.4.forecast_time.def component in this template. + include "grib2/template.4.horizontal.def" include "grib2/template.4.localtime_statistical.def" include "grib2/template.4.localtime.def" diff --git a/definitions/grib2/template.4.96.def b/definitions/grib2/template.4.96.def index f0d086cb4..b281bdb51 100644 --- a/definitions/grib2/template.4.96.def +++ b/definitions/grib2/template.4.96.def @@ -4,7 +4,13 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.generating_process.def" + +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" + #include "grib2/template.4.point_in_time.def" include "grib2/template.4.horizontal.def" include "grib2/template.4.eps.def" diff --git a/definitions/grib2/template.4.97.def b/definitions/grib2/template.4.97.def index 67b315ff1..930181ddc 100644 --- a/definitions/grib2/template.4.97.def +++ b/definitions/grib2/template.4.97.def @@ -5,7 +5,13 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" + +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" + #include "grib2/template.4.point_in_time.def" include "grib2/template.4.horizontal.def" include "grib2/template.4.localtime_statistical.def" diff --git a/definitions/grib2/template.4.98.def b/definitions/grib2/template.4.98.def index 12e70affe..23e493e74 100644 --- a/definitions/grib2/template.4.98.def +++ b/definitions/grib2/template.4.98.def @@ -5,7 +5,13 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" + +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" + #include "grib2/template.4.point_in_time.def" include "grib2/template.4.horizontal.def" include "grib2/template.4.eps.def" diff --git a/definitions/grib2/template.4.localtime.def b/definitions/grib2/template.4.localtime.def index 926c86770..26e9e0b84 100644 --- a/definitions/grib2/template.4.localtime.def +++ b/definitions/grib2/template.4.localtime.def @@ -78,6 +78,10 @@ if (numberOfForecastsUsedInLocalTime == 1) { alias mars.time = timeOfForecastUsedInLocalTime : dump; alias mars.step = endStep; + alias time.dataDate = dateOfForecastUsedInLocalTime; + alias time.dataTime = timeOfForecastUsedInLocalTime; + alias time.endStep = endStep; + } if (numberOfForecastsUsedInLocalTime > 1) { meta selectedFcIndex closest_date(dataDate, dataTime, @@ -106,5 +110,10 @@ if (numberOfForecastsUsedInLocalTime > 1) { alias mars.date = dateOfForecastUsedInLocalTime : dump; alias mars.time = timeOfForecastUsedInLocalTime : dump; alias mars.step = endStep; + + alias time.dataDate = dateOfForecastUsedInLocalTime; + alias time.dataTime = timeOfForecastUsedInLocalTime; + alias time.endStep = endStep; + } } From b68ff72386b2dc4bbe6a4b72b298cd1f72a47f73 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 12:45:00 +0000 Subject: [PATCH 031/212] ECC-1518: grib_to_netcdf: Error 'Cannot get stepUnits as string' --- definitions/grib2/template.4.93.def | 7 +------ definitions/grib2/template.4.94.def | 6 +----- definitions/grib2/template.4.95.def | 4 ---- definitions/grib2/template.4.96.def | 6 +----- definitions/grib2/template.4.97.def | 6 +----- definitions/grib2/template.4.98.def | 6 +----- definitions/grib2/template.4.localtime.def | 7 ++++++- tests/grib_ecc-1212.sh | 12 ++++++++++++ 8 files changed, 23 insertions(+), 31 deletions(-) diff --git a/definitions/grib2/template.4.93.def b/definitions/grib2/template.4.93.def index 8cb8a79bb..9ff2e882d 100644 --- a/definitions/grib2/template.4.93.def +++ b/definitions/grib2/template.4.93.def @@ -6,13 +6,8 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -alias time.stepUnits=stepUnits; - #include "grib2/template.4.forecast_time.def" - #include "grib2/template.4.point_in_time.def" + include "grib2/template.4.horizontal.def" include "grib2/template.4.localtime.def" diff --git a/definitions/grib2/template.4.94.def b/definitions/grib2/template.4.94.def index ff905d66a..26850a8c8 100644 --- a/definitions/grib2/template.4.94.def +++ b/definitions/grib2/template.4.94.def @@ -6,13 +6,9 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" - #include "grib2/template.4.point_in_time.def" + include "grib2/template.4.horizontal.def" include "grib2/template.4.eps.def" include "grib2/template.4.localtime.def" diff --git a/definitions/grib2/template.4.95.def b/definitions/grib2/template.4.95.def index e66a1d64d..5ffd5e1f2 100644 --- a/definitions/grib2/template.4.95.def +++ b/definitions/grib2/template.4.95.def @@ -5,10 +5,6 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.generating_process.def" -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -alias time.stepUnits=stepUnits; # no template.4.forecast_time.def component in this template. include "grib2/template.4.horizontal.def" diff --git a/definitions/grib2/template.4.96.def b/definitions/grib2/template.4.96.def index b281bdb51..043794cf4 100644 --- a/definitions/grib2/template.4.96.def +++ b/definitions/grib2/template.4.96.def @@ -5,13 +5,9 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.generating_process.def" -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" - #include "grib2/template.4.point_in_time.def" + include "grib2/template.4.horizontal.def" include "grib2/template.4.eps.def" include "grib2/template.4.localtime_statistical.def" diff --git a/definitions/grib2/template.4.97.def b/definitions/grib2/template.4.97.def index 930181ddc..1ea736ac7 100644 --- a/definitions/grib2/template.4.97.def +++ b/definitions/grib2/template.4.97.def @@ -6,13 +6,9 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" - #include "grib2/template.4.point_in_time.def" + include "grib2/template.4.horizontal.def" include "grib2/template.4.localtime_statistical.def" include "grib2/template.4.localtime.def" diff --git a/definitions/grib2/template.4.98.def b/definitions/grib2/template.4.98.def index 23e493e74..453f6689d 100644 --- a/definitions/grib2/template.4.98.def +++ b/definitions/grib2/template.4.98.def @@ -6,13 +6,9 @@ include "grib2/template.4.parameter.def" include "grib2/template.4.postproc.def" include "grib2/template.4.generating_process.def" -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -alias time.stepUnits=stepUnits; #include "grib2/template.4.forecast_time.def" - #include "grib2/template.4.point_in_time.def" + include "grib2/template.4.horizontal.def" include "grib2/template.4.eps.def" include "grib2/template.4.localtime_statistical.def" diff --git a/definitions/grib2/template.4.localtime.def b/definitions/grib2/template.4.localtime.def index 26e9e0b84..01491217c 100644 --- a/definitions/grib2/template.4.localtime.def +++ b/definitions/grib2/template.4.localtime.def @@ -3,6 +3,11 @@ remove is_localtime; transient is_localtime=1; +alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +alias time.stepUnits = stepUnits; + # Method used to calculate the field value at the local time specified in section 1 codetable[1] localTimeMethod ('4.248.table',masterDir,localDir)=255 : dump; @@ -45,7 +50,7 @@ localTimeForecastList list(numberOfForecastsUsedInLocalTime) unsigned[4] timeIncrement=0 : dump; } -alias ls.time=dataTime; +alias ls.time = dataTime; # See ECC-707 transient lsdate_bug = 1: hidden; transient lstime_bug = 1: hidden; diff --git a/tests/grib_ecc-1212.sh b/tests/grib_ecc-1212.sh index a26e69395..7ae426756 100755 --- a/tests/grib_ecc-1212.sh +++ b/tests/grib_ecc-1212.sh @@ -79,6 +79,11 @@ echo "2 ecmf 20200805 1200 an regular_ll surface 0 t cat $tempOut diff -w $tempRef $tempOut +# Check "time" namespace +${tools_dir}/grib_get -n time $tempGrib > $tempOut +echo "h 20200804 0000 36" > $tempRef +diff -w $tempRef $tempOut + # numberOfForecastsUsedInLocalTime > 1 # ------------------------------------ @@ -110,6 +115,13 @@ ${tools_dir}/grib_filter -o $tempGrib $tempFilt $sample_grib2 grib_check_key_equals $tempGrib selectedFcIndex,step '1 4' grib_check_key_equals $tempGrib mars.date,mars.time '20220607 300' +for pdtn in 88 92 93 94 95 96 97 98; do + ${tools_dir}/grib_set -s \ + tablesVersion=30,productDefinitionTemplateNumber=$pdtn,numberOfForecastsUsedInLocalTime=1 \ + $sample_grib2 $tempGrib + + grib_check_key_equals $tempGrib time.stepUnits:s,time.dataDate,time.dataTime 'h 0 0' +done # Clean up rm -f $tempGrib $tempFilt $tempOut $tempRef From bf80a67c0a2458052761c7474d1d114ed6356d43 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 12:48:55 +0000 Subject: [PATCH 032/212] Updates to lex/yacc: bison 3.8.2 --- src/grib_lex.cpp | 47 +- src/grib_yacc.cpp | 2027 ++++++++++++++++++++++----------------------- src/grib_yacc.h | 278 ++++--- 3 files changed, 1155 insertions(+), 1197 deletions(-) diff --git a/src/grib_lex.cpp b/src/grib_lex.cpp index c94d46e05..109003258 100644 --- a/src/grib_lex.cpp +++ b/src/grib_lex.cpp @@ -1,6 +1,6 @@ -#line 1 "gribl.c" +#line 1 "gribl.cpp" -#line 3 "gribl.c" +#line 3 "gribl.cpp" #define YY_INT_ALIGNED short int @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -155,7 +156,7 @@ typedef struct grib_yy_buffer_state *YY_BUFFER_STATE; typedef size_t grib_yy_size_t; #endif -extern int grib_yyleng; +extern grib_yy_size_t grib_yyleng; extern FILE *grib_yyin, *grib_yyout; @@ -198,7 +199,7 @@ struct grib_yy_buffer_state /* Number of characters read into grib_yy_ch_buf, not including EOB * characters. */ - int grib_yy_n_chars; + grib_yy_size_t grib_yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -267,8 +268,8 @@ static YY_BUFFER_STATE * grib_yy_buffer_stack = NULL; /**< Stack as an array. */ /* grib_yy_hold_char holds the character lost when grib_yytext is formed. */ static char grib_yy_hold_char; -static int grib_yy_n_chars; /* number of characters read into grib_yy_ch_buf */ -int grib_yyleng; +static grib_yy_size_t grib_yy_n_chars; /* number of characters read into grib_yy_ch_buf */ +grib_yy_size_t grib_yyleng; /* Points to current character in buffer. */ static char *grib_yy_c_buf_p = NULL; @@ -295,7 +296,7 @@ static void grib_yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); YY_BUFFER_STATE grib_yy_scan_buffer ( char *base, grib_yy_size_t size ); YY_BUFFER_STATE grib_yy_scan_string ( const char *grib_yy_str ); -YY_BUFFER_STATE grib_yy_scan_bytes ( const char *bytes, int len ); +YY_BUFFER_STATE grib_yy_scan_bytes ( const char *bytes, grib_yy_size_t len ); void *grib_yyalloc ( grib_yy_size_t ); void *grib_yyrealloc ( void *, grib_yy_size_t ); @@ -348,7 +349,7 @@ static void grib_yynoreturn grib_yy_fatal_error ( const char* msg ); */ #define YY_DO_BEFORE_ACTION \ (grib_yytext_ptr) = grib_yy_bp; \ - grib_yyleng = (int) (grib_yy_cp - grib_yy_bp); \ + grib_yyleng = (grib_yy_size_t) (grib_yy_cp - grib_yy_bp); \ (grib_yy_hold_char) = *grib_yy_cp; \ *grib_yy_cp = '\0'; \ (grib_yy_c_buf_p) = grib_yy_cp; @@ -1198,8 +1199,8 @@ void _grib_ignore_grib_yyunput_unused_error() { grib_yyunput(0,0); } #define GET_INPUT input #endif -#line 1201 "gribl.c" -#line 1202 "gribl.c" +#line 1202 "gribl.cpp" +#line 1203 "gribl.cpp" #define INITIAL 0 @@ -1238,7 +1239,7 @@ FILE *grib_yyget_out ( void ); void grib_yyset_out ( FILE * _out_str ); - int grib_yyget_leng ( void ); + grib_yy_size_t grib_yyget_leng ( void ); char *grib_yyget_text ( void ); @@ -1307,7 +1308,7 @@ static int input ( void ); if ( YY_CURRENT_BUFFER_LVALUE->grib_yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + grib_yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( grib_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1420,7 +1421,7 @@ YY_DECL -#line 1423 "gribl.c" +#line 1424 "gribl.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -2216,7 +2217,7 @@ YY_RULE_SETUP #line 284 "gribl.l" ECHO; YY_BREAK -#line 2219 "gribl.c" +#line 2220 "gribl.cpp" case YY_STATE_EOF(INITIAL): grib_yyterminate(); @@ -2403,7 +2404,7 @@ static int grib_yy_get_next_buffer (void) else { - int num_to_read = + grib_yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2417,7 +2418,7 @@ static int grib_yy_get_next_buffer (void) if ( b->grib_yy_is_our_buffer ) { - int new_size = b->grib_yy_buf_size * 2; + grib_yy_size_t new_size = b->grib_yy_buf_size * 2; if ( new_size <= 0 ) b->grib_yy_buf_size += b->grib_yy_buf_size / 8; @@ -2475,7 +2476,7 @@ static int grib_yy_get_next_buffer (void) if (((grib_yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (grib_yy_n_chars) + number_to_move + ((grib_yy_n_chars) >> 1); + grib_yy_size_t new_size = (grib_yy_n_chars) + number_to_move + ((grib_yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf = (char *) grib_yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf, (grib_yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf ) @@ -2564,7 +2565,7 @@ static int grib_yy_get_next_buffer (void) if ( grib_yy_cp < YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - int number_to_move = (grib_yy_n_chars) + 2; + grib_yy_size_t number_to_move = (grib_yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->grib_yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->grib_yy_buf_size + 2]; char *source = @@ -2615,7 +2616,7 @@ static int grib_yy_get_next_buffer (void) else { /* need more input */ - int offset = (int) ((grib_yy_c_buf_p) - (grib_yytext_ptr)); + grib_yy_size_t offset = (grib_yy_c_buf_p) - (grib_yytext_ptr); ++(grib_yy_c_buf_p); switch ( grib_yy_get_next_buffer( ) ) @@ -2984,12 +2985,12 @@ YY_BUFFER_STATE grib_yy_scan_string (const char * grib_yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE grib_yy_scan_bytes (const char * grib_yybytes, int _grib_yybytes_len ) +YY_BUFFER_STATE grib_yy_scan_bytes (const char * grib_yybytes, grib_yy_size_t _grib_yybytes_len ) { YY_BUFFER_STATE b; char *buf; grib_yy_size_t n; - int i; + grib_yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (grib_yy_size_t) (_grib_yybytes_len + 2); @@ -3031,7 +3032,7 @@ static void grib_yynoreturn grib_yy_fatal_error (const char* msg ) do \ { \ /* Undo effects of setting up grib_yytext. */ \ - int grib_yyless_macro_arg = (n); \ + grib_yy_size_t grib_yyless_macro_arg = (n); \ YY_LESS_LINENO(grib_yyless_macro_arg);\ grib_yytext[grib_yyleng] = (grib_yy_hold_char); \ (grib_yy_c_buf_p) = grib_yytext + grib_yyless_macro_arg; \ @@ -3071,7 +3072,7 @@ FILE *grib_yyget_out (void) /** Get the length of the current token. * */ -int grib_yyget_leng (void) +grib_yy_size_t grib_yyget_leng (void) { return grib_yyleng; } diff --git a/src/grib_yacc.cpp b/src/grib_yacc.cpp index 09bbbb45f..b8d94ab2c 100644 --- a/src/grib_yacc.cpp +++ b/src/grib_yacc.cpp @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.4. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or grib_yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with grib_yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.5.4" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -93,7 +94,7 @@ static grib_hash_array_value *_reverse_hash_array(grib_hash_array_value *r,grib_ -#line 97 "y.tab.c" +#line 98 "y.tab.c" # ifndef YY_CAST # ifdef __cplusplus @@ -116,14 +117,6 @@ static grib_hash_array_value *_reverse_hash_array(grib_hash_array_value *r,grib_ # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - /* Use api.header.include to #include this header instead of duplicating it here. */ #ifndef YY_YY_Y_TAB_H_INCLUDED @@ -136,138 +129,147 @@ static grib_hash_array_value *_reverse_hash_array(grib_hash_array_value *r,grib_ extern int grib_yydebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum grib_yytokentype { - LOWERCASE = 258, - IF = 259, - IF_TRANSIENT = 260, - ELSE = 261, - END = 262, - CLOSE = 263, - UNSIGNED = 264, - TEMPLATE = 265, - TEMPLATE_NOFAIL = 266, - TRIGGER = 267, - ASCII = 268, - GROUP = 269, - NON_ALPHA = 270, - KSEC1EXPVER = 271, - LABEL = 272, - LIST = 273, - IS_IN_LIST = 274, - IS_IN_DICT = 275, - IS_INTEGER = 276, - TO_INTEGER = 277, - TO_STRING = 278, - SEX2DEC = 279, - WHILE = 280, - IBMFLOAT = 281, - SIGNED = 282, - UINT8 = 283, - INT8 = 284, - UINT16 = 285, - INT16 = 286, - UINT16_LITTLE_ENDIAN = 287, - INT16_LITTLE_ENDIAN = 288, - UINT32 = 289, - INT32 = 290, - UINT32_LITTLE_ENDIAN = 291, - INT32_LITTLE_ENDIAN = 292, - UINT64 = 293, - INT64 = 294, - UINT64_LITTLE_ENDIAN = 295, - INT64_LITTLE_ENDIAN = 296, - BLOB = 297, - BYTE = 298, - CODETABLE = 299, - SMART_TABLE = 300, - DICTIONARY = 301, - COMPLEX_CODETABLE = 302, - LOOKUP = 303, - ALIAS = 304, - UNALIAS = 305, - META = 306, - POS = 307, - INTCONST = 308, - TRANS = 309, - FLAGBIT = 310, - CONCEPT = 311, - GETENV = 312, - HASH_ARRAY = 313, - CONCEPT_NOFAIL = 314, - NIL = 315, - DUMMY = 316, - MODIFY = 317, - READ_ONLY = 318, - STRING_TYPE = 319, - LONG_TYPE = 320, - DOUBLE_TYPE = 321, - NO_COPY = 322, - DUMP = 323, - JSON = 324, - XML = 325, - NO_FAIL = 326, - EDITION_SPECIFIC = 327, - OVERRIDE = 328, - HIDDEN = 329, - CAN_BE_MISSING = 330, - MISSING = 331, - CONSTRAINT = 332, - COPY_OK = 333, - WHEN = 334, - SET = 335, - SET_NOFAIL = 336, - WRITE = 337, - APPEND = 338, - PRINT = 339, - EXPORT = 340, - REMOVE = 341, - RENAME = 342, - SKIP = 343, - PAD = 344, - SECTION_PADDING = 345, - MESSAGE = 346, - MESSAGE_COPY = 347, - PADTO = 348, - PADTOEVEN = 349, - PADTOMULTIPLE = 350, - G1_HALF_BYTE = 351, - G1_MESSAGE_LENGTH = 352, - G1_SECTION4_LENGTH = 353, - SECTION_LENGTH = 354, - LENGTH = 355, - FLAG = 356, - ITERATOR = 357, - NEAREST = 358, - BOX = 359, - KSEC = 360, - ASSERT = 361, - SUBSTR = 362, - CASE = 363, - SWITCH = 364, - DEFAULT = 365, - EQ = 366, - NE = 367, - GE = 368, - LE = 369, - LT = 370, - GT = 371, - BIT = 372, - BITOFF = 373, - AND = 374, - OR = 375, - NOT = 376, - IS = 377, - IDENT = 378, - STRING = 379, - INTEGER = 380, - FLOAT = 381 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + LOWERCASE = 258, /* LOWERCASE */ + IF = 259, /* IF */ + IF_TRANSIENT = 260, /* IF_TRANSIENT */ + ELSE = 261, /* ELSE */ + END = 262, /* END */ + CLOSE = 263, /* CLOSE */ + UNSIGNED = 264, /* UNSIGNED */ + TEMPLATE = 265, /* TEMPLATE */ + TEMPLATE_NOFAIL = 266, /* TEMPLATE_NOFAIL */ + TRIGGER = 267, /* TRIGGER */ + ASCII = 268, /* ASCII */ + GROUP = 269, /* GROUP */ + NON_ALPHA = 270, /* NON_ALPHA */ + KSEC1EXPVER = 271, /* KSEC1EXPVER */ + LABEL = 272, /* LABEL */ + LIST = 273, /* LIST */ + IS_IN_LIST = 274, /* IS_IN_LIST */ + IS_IN_DICT = 275, /* IS_IN_DICT */ + IS_INTEGER = 276, /* IS_INTEGER */ + TO_INTEGER = 277, /* TO_INTEGER */ + TO_STRING = 278, /* TO_STRING */ + SEX2DEC = 279, /* SEX2DEC */ + WHILE = 280, /* WHILE */ + IBMFLOAT = 281, /* IBMFLOAT */ + SIGNED = 282, /* SIGNED */ + UINT8 = 283, /* UINT8 */ + INT8 = 284, /* INT8 */ + UINT16 = 285, /* UINT16 */ + INT16 = 286, /* INT16 */ + UINT16_LITTLE_ENDIAN = 287, /* UINT16_LITTLE_ENDIAN */ + INT16_LITTLE_ENDIAN = 288, /* INT16_LITTLE_ENDIAN */ + UINT32 = 289, /* UINT32 */ + INT32 = 290, /* INT32 */ + UINT32_LITTLE_ENDIAN = 291, /* UINT32_LITTLE_ENDIAN */ + INT32_LITTLE_ENDIAN = 292, /* INT32_LITTLE_ENDIAN */ + UINT64 = 293, /* UINT64 */ + INT64 = 294, /* INT64 */ + UINT64_LITTLE_ENDIAN = 295, /* UINT64_LITTLE_ENDIAN */ + INT64_LITTLE_ENDIAN = 296, /* INT64_LITTLE_ENDIAN */ + BLOB = 297, /* BLOB */ + BYTE = 298, /* BYTE */ + CODETABLE = 299, /* CODETABLE */ + SMART_TABLE = 300, /* SMART_TABLE */ + DICTIONARY = 301, /* DICTIONARY */ + COMPLEX_CODETABLE = 302, /* COMPLEX_CODETABLE */ + LOOKUP = 303, /* LOOKUP */ + ALIAS = 304, /* ALIAS */ + UNALIAS = 305, /* UNALIAS */ + META = 306, /* META */ + POS = 307, /* POS */ + INTCONST = 308, /* INTCONST */ + TRANS = 309, /* TRANS */ + FLAGBIT = 310, /* FLAGBIT */ + CONCEPT = 311, /* CONCEPT */ + GETENV = 312, /* GETENV */ + HASH_ARRAY = 313, /* HASH_ARRAY */ + CONCEPT_NOFAIL = 314, /* CONCEPT_NOFAIL */ + NIL = 315, /* NIL */ + DUMMY = 316, /* DUMMY */ + MODIFY = 317, /* MODIFY */ + READ_ONLY = 318, /* READ_ONLY */ + STRING_TYPE = 319, /* STRING_TYPE */ + LONG_TYPE = 320, /* LONG_TYPE */ + DOUBLE_TYPE = 321, /* DOUBLE_TYPE */ + NO_COPY = 322, /* NO_COPY */ + DUMP = 323, /* DUMP */ + JSON = 324, /* JSON */ + XML = 325, /* XML */ + NO_FAIL = 326, /* NO_FAIL */ + EDITION_SPECIFIC = 327, /* EDITION_SPECIFIC */ + OVERRIDE = 328, /* OVERRIDE */ + HIDDEN = 329, /* HIDDEN */ + CAN_BE_MISSING = 330, /* CAN_BE_MISSING */ + MISSING = 331, /* MISSING */ + CONSTRAINT = 332, /* CONSTRAINT */ + COPY_OK = 333, /* COPY_OK */ + WHEN = 334, /* WHEN */ + SET = 335, /* SET */ + SET_NOFAIL = 336, /* SET_NOFAIL */ + WRITE = 337, /* WRITE */ + APPEND = 338, /* APPEND */ + PRINT = 339, /* PRINT */ + EXPORT = 340, /* EXPORT */ + REMOVE = 341, /* REMOVE */ + RENAME = 342, /* RENAME */ + SKIP = 343, /* SKIP */ + PAD = 344, /* PAD */ + SECTION_PADDING = 345, /* SECTION_PADDING */ + MESSAGE = 346, /* MESSAGE */ + MESSAGE_COPY = 347, /* MESSAGE_COPY */ + PADTO = 348, /* PADTO */ + PADTOEVEN = 349, /* PADTOEVEN */ + PADTOMULTIPLE = 350, /* PADTOMULTIPLE */ + G1_HALF_BYTE = 351, /* G1_HALF_BYTE */ + G1_MESSAGE_LENGTH = 352, /* G1_MESSAGE_LENGTH */ + G1_SECTION4_LENGTH = 353, /* G1_SECTION4_LENGTH */ + SECTION_LENGTH = 354, /* SECTION_LENGTH */ + LENGTH = 355, /* LENGTH */ + FLAG = 356, /* FLAG */ + ITERATOR = 357, /* ITERATOR */ + NEAREST = 358, /* NEAREST */ + BOX = 359, /* BOX */ + KSEC = 360, /* KSEC */ + ASSERT = 361, /* ASSERT */ + SUBSTR = 362, /* SUBSTR */ + CASE = 363, /* CASE */ + SWITCH = 364, /* SWITCH */ + DEFAULT = 365, /* DEFAULT */ + EQ = 366, /* EQ */ + NE = 367, /* NE */ + GE = 368, /* GE */ + LE = 369, /* LE */ + LT = 370, /* LT */ + GT = 371, /* GT */ + BIT = 372, /* BIT */ + BITOFF = 373, /* BITOFF */ + AND = 374, /* AND */ + OR = 375, /* OR */ + NOT = 376, /* NOT */ + IS = 377, /* IS */ + IDENT = 378, /* IDENT */ + STRING = 379, /* STRING */ + INTEGER = 380, /* INTEGER */ + FLOAT = 381 /* FLOAT */ }; + typedef enum grib_yytokentype grib_yytoken_kind_t; #endif -/* Tokens. */ +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 #define LOWERCASE 258 #define IF 259 #define IF_TRANSIENT 260 @@ -411,11 +413,11 @@ union YYSTYPE grib_concept_condition *concept_condition; grib_concept_value *concept_value; grib_hash_array_value *hash_array_value; - grib_case *case_value; + grib_case *case_value; grib_rule *rules; grib_rule_entry *rule_entry; -#line 419 "y.tab.c" +#line 421 "y.tab.c" }; typedef union YYSTYPE YYSTYPE; @@ -426,9 +428,212 @@ typedef union YYSTYPE YYSTYPE; extern YYSTYPE grib_yylval; + int grib_yyparse (void); + #endif /* !YY_YY_Y_TAB_H_INCLUDED */ +/* Symbol kind. */ +enum grib_yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_LOWERCASE = 3, /* LOWERCASE */ + YYSYMBOL_IF = 4, /* IF */ + YYSYMBOL_IF_TRANSIENT = 5, /* IF_TRANSIENT */ + YYSYMBOL_ELSE = 6, /* ELSE */ + YYSYMBOL_END = 7, /* END */ + YYSYMBOL_CLOSE = 8, /* CLOSE */ + YYSYMBOL_UNSIGNED = 9, /* UNSIGNED */ + YYSYMBOL_TEMPLATE = 10, /* TEMPLATE */ + YYSYMBOL_TEMPLATE_NOFAIL = 11, /* TEMPLATE_NOFAIL */ + YYSYMBOL_TRIGGER = 12, /* TRIGGER */ + YYSYMBOL_ASCII = 13, /* ASCII */ + YYSYMBOL_GROUP = 14, /* GROUP */ + YYSYMBOL_NON_ALPHA = 15, /* NON_ALPHA */ + YYSYMBOL_KSEC1EXPVER = 16, /* KSEC1EXPVER */ + YYSYMBOL_LABEL = 17, /* LABEL */ + YYSYMBOL_LIST = 18, /* LIST */ + YYSYMBOL_IS_IN_LIST = 19, /* IS_IN_LIST */ + YYSYMBOL_IS_IN_DICT = 20, /* IS_IN_DICT */ + YYSYMBOL_IS_INTEGER = 21, /* IS_INTEGER */ + YYSYMBOL_TO_INTEGER = 22, /* TO_INTEGER */ + YYSYMBOL_TO_STRING = 23, /* TO_STRING */ + YYSYMBOL_SEX2DEC = 24, /* SEX2DEC */ + YYSYMBOL_WHILE = 25, /* WHILE */ + YYSYMBOL_IBMFLOAT = 26, /* IBMFLOAT */ + YYSYMBOL_SIGNED = 27, /* SIGNED */ + YYSYMBOL_UINT8 = 28, /* UINT8 */ + YYSYMBOL_INT8 = 29, /* INT8 */ + YYSYMBOL_UINT16 = 30, /* UINT16 */ + YYSYMBOL_INT16 = 31, /* INT16 */ + YYSYMBOL_UINT16_LITTLE_ENDIAN = 32, /* UINT16_LITTLE_ENDIAN */ + YYSYMBOL_INT16_LITTLE_ENDIAN = 33, /* INT16_LITTLE_ENDIAN */ + YYSYMBOL_UINT32 = 34, /* UINT32 */ + YYSYMBOL_INT32 = 35, /* INT32 */ + YYSYMBOL_UINT32_LITTLE_ENDIAN = 36, /* UINT32_LITTLE_ENDIAN */ + YYSYMBOL_INT32_LITTLE_ENDIAN = 37, /* INT32_LITTLE_ENDIAN */ + YYSYMBOL_UINT64 = 38, /* UINT64 */ + YYSYMBOL_INT64 = 39, /* INT64 */ + YYSYMBOL_UINT64_LITTLE_ENDIAN = 40, /* UINT64_LITTLE_ENDIAN */ + YYSYMBOL_INT64_LITTLE_ENDIAN = 41, /* INT64_LITTLE_ENDIAN */ + YYSYMBOL_BLOB = 42, /* BLOB */ + YYSYMBOL_BYTE = 43, /* BYTE */ + YYSYMBOL_CODETABLE = 44, /* CODETABLE */ + YYSYMBOL_SMART_TABLE = 45, /* SMART_TABLE */ + YYSYMBOL_DICTIONARY = 46, /* DICTIONARY */ + YYSYMBOL_COMPLEX_CODETABLE = 47, /* COMPLEX_CODETABLE */ + YYSYMBOL_LOOKUP = 48, /* LOOKUP */ + YYSYMBOL_ALIAS = 49, /* ALIAS */ + YYSYMBOL_UNALIAS = 50, /* UNALIAS */ + YYSYMBOL_META = 51, /* META */ + YYSYMBOL_POS = 52, /* POS */ + YYSYMBOL_INTCONST = 53, /* INTCONST */ + YYSYMBOL_TRANS = 54, /* TRANS */ + YYSYMBOL_FLAGBIT = 55, /* FLAGBIT */ + YYSYMBOL_CONCEPT = 56, /* CONCEPT */ + YYSYMBOL_GETENV = 57, /* GETENV */ + YYSYMBOL_HASH_ARRAY = 58, /* HASH_ARRAY */ + YYSYMBOL_CONCEPT_NOFAIL = 59, /* CONCEPT_NOFAIL */ + YYSYMBOL_NIL = 60, /* NIL */ + YYSYMBOL_DUMMY = 61, /* DUMMY */ + YYSYMBOL_MODIFY = 62, /* MODIFY */ + YYSYMBOL_READ_ONLY = 63, /* READ_ONLY */ + YYSYMBOL_STRING_TYPE = 64, /* STRING_TYPE */ + YYSYMBOL_LONG_TYPE = 65, /* LONG_TYPE */ + YYSYMBOL_DOUBLE_TYPE = 66, /* DOUBLE_TYPE */ + YYSYMBOL_NO_COPY = 67, /* NO_COPY */ + YYSYMBOL_DUMP = 68, /* DUMP */ + YYSYMBOL_JSON = 69, /* JSON */ + YYSYMBOL_XML = 70, /* XML */ + YYSYMBOL_NO_FAIL = 71, /* NO_FAIL */ + YYSYMBOL_EDITION_SPECIFIC = 72, /* EDITION_SPECIFIC */ + YYSYMBOL_OVERRIDE = 73, /* OVERRIDE */ + YYSYMBOL_HIDDEN = 74, /* HIDDEN */ + YYSYMBOL_CAN_BE_MISSING = 75, /* CAN_BE_MISSING */ + YYSYMBOL_MISSING = 76, /* MISSING */ + YYSYMBOL_CONSTRAINT = 77, /* CONSTRAINT */ + YYSYMBOL_COPY_OK = 78, /* COPY_OK */ + YYSYMBOL_WHEN = 79, /* WHEN */ + YYSYMBOL_SET = 80, /* SET */ + YYSYMBOL_SET_NOFAIL = 81, /* SET_NOFAIL */ + YYSYMBOL_WRITE = 82, /* WRITE */ + YYSYMBOL_APPEND = 83, /* APPEND */ + YYSYMBOL_PRINT = 84, /* PRINT */ + YYSYMBOL_EXPORT = 85, /* EXPORT */ + YYSYMBOL_REMOVE = 86, /* REMOVE */ + YYSYMBOL_RENAME = 87, /* RENAME */ + YYSYMBOL_SKIP = 88, /* SKIP */ + YYSYMBOL_PAD = 89, /* PAD */ + YYSYMBOL_SECTION_PADDING = 90, /* SECTION_PADDING */ + YYSYMBOL_MESSAGE = 91, /* MESSAGE */ + YYSYMBOL_MESSAGE_COPY = 92, /* MESSAGE_COPY */ + YYSYMBOL_PADTO = 93, /* PADTO */ + YYSYMBOL_PADTOEVEN = 94, /* PADTOEVEN */ + YYSYMBOL_PADTOMULTIPLE = 95, /* PADTOMULTIPLE */ + YYSYMBOL_G1_HALF_BYTE = 96, /* G1_HALF_BYTE */ + YYSYMBOL_G1_MESSAGE_LENGTH = 97, /* G1_MESSAGE_LENGTH */ + YYSYMBOL_G1_SECTION4_LENGTH = 98, /* G1_SECTION4_LENGTH */ + YYSYMBOL_SECTION_LENGTH = 99, /* SECTION_LENGTH */ + YYSYMBOL_LENGTH = 100, /* LENGTH */ + YYSYMBOL_FLAG = 101, /* FLAG */ + YYSYMBOL_ITERATOR = 102, /* ITERATOR */ + YYSYMBOL_NEAREST = 103, /* NEAREST */ + YYSYMBOL_BOX = 104, /* BOX */ + YYSYMBOL_KSEC = 105, /* KSEC */ + YYSYMBOL_ASSERT = 106, /* ASSERT */ + YYSYMBOL_SUBSTR = 107, /* SUBSTR */ + YYSYMBOL_CASE = 108, /* CASE */ + YYSYMBOL_SWITCH = 109, /* SWITCH */ + YYSYMBOL_DEFAULT = 110, /* DEFAULT */ + YYSYMBOL_EQ = 111, /* EQ */ + YYSYMBOL_NE = 112, /* NE */ + YYSYMBOL_GE = 113, /* GE */ + YYSYMBOL_LE = 114, /* LE */ + YYSYMBOL_LT = 115, /* LT */ + YYSYMBOL_GT = 116, /* GT */ + YYSYMBOL_BIT = 117, /* BIT */ + YYSYMBOL_BITOFF = 118, /* BITOFF */ + YYSYMBOL_AND = 119, /* AND */ + YYSYMBOL_OR = 120, /* OR */ + YYSYMBOL_NOT = 121, /* NOT */ + YYSYMBOL_IS = 122, /* IS */ + YYSYMBOL_IDENT = 123, /* IDENT */ + YYSYMBOL_STRING = 124, /* STRING */ + YYSYMBOL_INTEGER = 125, /* INTEGER */ + YYSYMBOL_FLOAT = 126, /* FLOAT */ + YYSYMBOL_127_ = 127, /* ',' */ + YYSYMBOL_128_ = 128, /* ';' */ + YYSYMBOL_129_ = 129, /* '[' */ + YYSYMBOL_130_ = 130, /* ']' */ + YYSYMBOL_131_ = 131, /* '(' */ + YYSYMBOL_132_ = 132, /* ')' */ + YYSYMBOL_133_ = 133, /* '=' */ + YYSYMBOL_134_ = 134, /* '.' */ + YYSYMBOL_135_ = 135, /* '{' */ + YYSYMBOL_136_ = 136, /* '}' */ + YYSYMBOL_137_ = 137, /* ':' */ + YYSYMBOL_138_ = 138, /* '-' */ + YYSYMBOL_139_ = 139, /* '^' */ + YYSYMBOL_140_ = 140, /* '*' */ + YYSYMBOL_141_ = 141, /* '/' */ + YYSYMBOL_142_ = 142, /* '%' */ + YYSYMBOL_143_ = 143, /* '+' */ + YYSYMBOL_YYACCEPT = 144, /* $accept */ + YYSYMBOL_all = 145, /* all */ + YYSYMBOL_empty = 146, /* empty */ + YYSYMBOL_dvalues = 147, /* dvalues */ + YYSYMBOL_svalues = 148, /* svalues */ + YYSYMBOL_integer_array = 149, /* integer_array */ + YYSYMBOL_instructions = 150, /* instructions */ + YYSYMBOL_instruction = 151, /* instruction */ + YYSYMBOL_semi = 152, /* semi */ + YYSYMBOL_argument_list = 153, /* argument_list */ + YYSYMBOL_arguments = 154, /* arguments */ + YYSYMBOL_argument = 155, /* argument */ + YYSYMBOL_simple = 156, /* simple */ + YYSYMBOL_if_block = 157, /* if_block */ + YYSYMBOL_when_block = 158, /* when_block */ + YYSYMBOL_set = 159, /* set */ + YYSYMBOL_set_list = 160, /* set_list */ + YYSYMBOL_default = 161, /* default */ + YYSYMBOL_flags = 162, /* flags */ + YYSYMBOL_flag_list = 163, /* flag_list */ + YYSYMBOL_flag = 164, /* flag */ + YYSYMBOL_list_block = 165, /* list_block */ + YYSYMBOL_while_block = 166, /* while_block */ + YYSYMBOL_trigger_block = 167, /* trigger_block */ + YYSYMBOL_concept_block = 168, /* concept_block */ + YYSYMBOL_concept_list = 169, /* concept_list */ + YYSYMBOL_hash_array_list = 170, /* hash_array_list */ + YYSYMBOL_hash_array_block = 171, /* hash_array_block */ + YYSYMBOL_case_list = 172, /* case_list */ + YYSYMBOL_case_value = 173, /* case_value */ + YYSYMBOL_switch_block = 174, /* switch_block */ + YYSYMBOL_concept_value = 175, /* concept_value */ + YYSYMBOL_concept_conditions = 176, /* concept_conditions */ + YYSYMBOL_concept_condition = 177, /* concept_condition */ + YYSYMBOL_hash_array_value = 178, /* hash_array_value */ + YYSYMBOL_string_or_ident = 179, /* string_or_ident */ + YYSYMBOL_atom = 180, /* atom */ + YYSYMBOL_power = 181, /* power */ + YYSYMBOL_factor = 182, /* factor */ + YYSYMBOL_term = 183, /* term */ + YYSYMBOL_condition = 184, /* condition */ + YYSYMBOL_conjunction = 185, /* conjunction */ + YYSYMBOL_disjunction = 186, /* disjunction */ + YYSYMBOL_expression = 187, /* expression */ + YYSYMBOL_rule = 188, /* rule */ + YYSYMBOL_rule_entry = 189, /* rule_entry */ + YYSYMBOL_rule_entries = 190, /* rule_entries */ + YYSYMBOL_fact = 191, /* fact */ + YYSYMBOL_conditional_rule = 192, /* conditional_rule */ + YYSYMBOL_rules = 193 /* rules */ +}; +typedef enum grib_yysymbol_kind_t grib_yysymbol_kind_t; + @@ -469,6 +674,18 @@ typedef int_least16_t grib_yytype_int16; typedef short grib_yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ grib_yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -528,6 +745,7 @@ typedef int grib_yytype_uint16; #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + /* Stored state numbers (used for stacks). */ typedef grib_yytype_int16 grib_yy_state_t; @@ -546,6 +764,7 @@ typedef int grib_yy_state_fast_t; # endif #endif + #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) @@ -564,17 +783,23 @@ typedef int grib_yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about grib_yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -603,7 +828,7 @@ typedef int grib_yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if ! defined grib_yyoverflow || YYERROR_VERBOSE +#if !defined grib_yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -668,8 +893,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined grib_yyoverflow || YYERROR_VERBOSE */ - +#endif /* !defined grib_yyoverflow */ #if (! defined grib_yyoverflow \ && (! defined __cplusplus \ @@ -745,14 +969,16 @@ union grib_yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 903 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 381 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by grib_yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK ? grib_yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (grib_yysymbol_kind_t, grib_yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by grib_yylex. */ @@ -800,7 +1026,7 @@ static const grib_yytype_uint8 grib_yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const grib_yytype_int16 grib_yyrline[] = { 0, 262, 262, 264, 265, 266, 267, 269, 273, 276, @@ -833,27 +1059,34 @@ static const grib_yytype_int16 grib_yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (grib_yysymbol_kind_t, grib_yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *grib_yysymbol_name (grib_yysymbol_kind_t grib_yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const grib_yytname[] = { - "$end", "error", "$undefined", "LOWERCASE", "IF", "IF_TRANSIENT", - "ELSE", "END", "CLOSE", "UNSIGNED", "TEMPLATE", "TEMPLATE_NOFAIL", - "TRIGGER", "ASCII", "GROUP", "NON_ALPHA", "KSEC1EXPVER", "LABEL", "LIST", - "IS_IN_LIST", "IS_IN_DICT", "IS_INTEGER", "TO_INTEGER", "TO_STRING", - "SEX2DEC", "WHILE", "IBMFLOAT", "SIGNED", "UINT8", "INT8", "UINT16", - "INT16", "UINT16_LITTLE_ENDIAN", "INT16_LITTLE_ENDIAN", "UINT32", - "INT32", "UINT32_LITTLE_ENDIAN", "INT32_LITTLE_ENDIAN", "UINT64", - "INT64", "UINT64_LITTLE_ENDIAN", "INT64_LITTLE_ENDIAN", "BLOB", "BYTE", - "CODETABLE", "SMART_TABLE", "DICTIONARY", "COMPLEX_CODETABLE", "LOOKUP", - "ALIAS", "UNALIAS", "META", "POS", "INTCONST", "TRANS", "FLAGBIT", - "CONCEPT", "GETENV", "HASH_ARRAY", "CONCEPT_NOFAIL", "NIL", "DUMMY", - "MODIFY", "READ_ONLY", "STRING_TYPE", "LONG_TYPE", "DOUBLE_TYPE", - "NO_COPY", "DUMP", "JSON", "XML", "NO_FAIL", "EDITION_SPECIFIC", - "OVERRIDE", "HIDDEN", "CAN_BE_MISSING", "MISSING", "CONSTRAINT", - "COPY_OK", "WHEN", "SET", "SET_NOFAIL", "WRITE", "APPEND", "PRINT", - "EXPORT", "REMOVE", "RENAME", "SKIP", "PAD", "SECTION_PADDING", + "\"end of file\"", "error", "\"invalid token\"", "LOWERCASE", "IF", + "IF_TRANSIENT", "ELSE", "END", "CLOSE", "UNSIGNED", "TEMPLATE", + "TEMPLATE_NOFAIL", "TRIGGER", "ASCII", "GROUP", "NON_ALPHA", + "KSEC1EXPVER", "LABEL", "LIST", "IS_IN_LIST", "IS_IN_DICT", "IS_INTEGER", + "TO_INTEGER", "TO_STRING", "SEX2DEC", "WHILE", "IBMFLOAT", "SIGNED", + "UINT8", "INT8", "UINT16", "INT16", "UINT16_LITTLE_ENDIAN", + "INT16_LITTLE_ENDIAN", "UINT32", "INT32", "UINT32_LITTLE_ENDIAN", + "INT32_LITTLE_ENDIAN", "UINT64", "INT64", "UINT64_LITTLE_ENDIAN", + "INT64_LITTLE_ENDIAN", "BLOB", "BYTE", "CODETABLE", "SMART_TABLE", + "DICTIONARY", "COMPLEX_CODETABLE", "LOOKUP", "ALIAS", "UNALIAS", "META", + "POS", "INTCONST", "TRANS", "FLAGBIT", "CONCEPT", "GETENV", "HASH_ARRAY", + "CONCEPT_NOFAIL", "NIL", "DUMMY", "MODIFY", "READ_ONLY", "STRING_TYPE", + "LONG_TYPE", "DOUBLE_TYPE", "NO_COPY", "DUMP", "JSON", "XML", "NO_FAIL", + "EDITION_SPECIFIC", "OVERRIDE", "HIDDEN", "CAN_BE_MISSING", "MISSING", + "CONSTRAINT", "COPY_OK", "WHEN", "SET", "SET_NOFAIL", "WRITE", "APPEND", + "PRINT", "EXPORT", "REMOVE", "RENAME", "SKIP", "PAD", "SECTION_PADDING", "MESSAGE", "MESSAGE_COPY", "PADTO", "PADTOEVEN", "PADTOMULTIPLE", "G1_HALF_BYTE", "G1_MESSAGE_LENGTH", "G1_SECTION4_LENGTH", "SECTION_LENGTH", "LENGTH", "FLAG", "ITERATOR", "NEAREST", "BOX", "KSEC", @@ -872,30 +1105,13 @@ static const char *const grib_yytname[] = "condition", "conjunction", "disjunction", "expression", "rule", "rule_entry", "rule_entries", "fact", "conditional_rule", "rules", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const grib_yytype_int16 grib_yytoknum[] = +static const char * +grib_yysymbol_name (grib_yysymbol_kind_t grib_yysymbol) { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 44, 59, 91, - 93, 40, 41, 61, 46, 123, 125, 58, 45, 94, - 42, 47, 37, 43 -}; -# endif + return grib_yytname[grib_yysymbol]; +} +#endif #define YYPACT_NINF (-654) @@ -907,8 +1123,8 @@ static const grib_yytype_int16 grib_yytoknum[] = #define grib_yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const grib_yytype_int16 grib_yypact[] = { 1435, -654, -24, -10, 8, 65, -67, 115, 162, 147, @@ -1004,9 +1220,9 @@ static const grib_yytype_int16 grib_yypact[] = -654, -654, -654 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const grib_yytype_int16 grib_yydefact[] = { 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1102,7 +1318,7 @@ static const grib_yytype_int16 grib_yydefact[] = 178, 180, 188 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const grib_yytype_int16 grib_yypgoto[] = { -654, -654, 5, 564, -654, -351, 0, -654, -653, 242, @@ -1112,19 +1328,19 @@ static const grib_yytype_int16 grib_yypgoto[] = -160, 691, -654, -96, -654, 14, 392, -654, -654, 913 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const grib_yytype_int16 grib_yydefgoto[] = { - -1, 80, 290, 545, 567, 503, 615, 83, 669, 176, + 0, 80, 290, 545, 567, 503, 615, 83, 669, 176, 177, 178, 84, 85, 86, 666, 667, 243, 291, 441, 442, 87, 88, 89, 90, 91, 92, 93, 685, 686, 94, 95, 505, 506, 96, 179, 180, 181, 182, 183, 184, 185, 186, 187, 97, 616, 617, 99, 100, 101 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const grib_yytype_int16 grib_yytable[] = { 82, 564, 224, 462, 508, 81, 231, 232, 305, 308, @@ -1513,8 +1729,8 @@ static const grib_yytype_int16 grib_yycheck[] = -1, -1, 126 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const grib_yytype_uint8 grib_yystos[] = { 0, 1, 4, 5, 8, 9, 10, 11, 12, 13, @@ -1610,7 +1826,7 @@ static const grib_yytype_uint8 grib_yystos[] = 162, 162, 162 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const grib_yytype_uint8 grib_yyr1[] = { 0, 144, 145, 145, 145, 145, 145, 145, 146, 147, @@ -1642,7 +1858,7 @@ static const grib_yytype_uint8 grib_yyr1[] = 189, 189, 190, 190, 191, 192, 193, 193 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const grib_yytype_int8 grib_yyr2[] = { 0, 2, 1, 1, 1, 1, 1, 1, 0, 1, @@ -1675,14 +1891,15 @@ static const grib_yytype_int8 grib_yyr2[] = }; +enum { YYENOMEM = -2 }; + #define grib_yyerrok (grib_yyerrstatus = 0) #define grib_yyclearin (grib_yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 #define YYACCEPT goto grib_yyacceptlab #define YYABORT goto grib_yyabortlab #define YYERROR goto grib_yyerrorlab +#define YYNOMEM goto grib_yyexhaustedlab #define YYRECOVERING() (!!grib_yyerrstatus) @@ -1704,10 +1921,9 @@ static const grib_yytype_int8 grib_yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* Enable debugging if requested. */ @@ -1724,19 +1940,16 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (grib_yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ grib_yy_symbol_print (stderr, \ - Type, Value); \ + Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -1747,18 +1960,15 @@ do { \ `-----------------------------------*/ static void -grib_yy_symbol_value_print (FILE *grib_yyo, int grib_yytype, YYSTYPE const * const grib_yyvaluep) +grib_yy_symbol_value_print (FILE *grib_yyo, + grib_yysymbol_kind_t grib_yykind, YYSTYPE const * const grib_yyvaluep) { FILE *grib_yyoutput = grib_yyo; - YYUSE (grib_yyoutput); + YY_USE (grib_yyoutput); if (!grib_yyvaluep) return; -# ifdef YYPRINT - if (grib_yytype < YYNTOKENS) - YYPRINT (grib_yyo, grib_yytoknum[grib_yytype], *grib_yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (grib_yytype); + YY_USE (grib_yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1768,12 +1978,13 @@ grib_yy_symbol_value_print (FILE *grib_yyo, int grib_yytype, YYSTYPE const * con `---------------------------*/ static void -grib_yy_symbol_print (FILE *grib_yyo, int grib_yytype, YYSTYPE const * const grib_yyvaluep) +grib_yy_symbol_print (FILE *grib_yyo, + grib_yysymbol_kind_t grib_yykind, YYSTYPE const * const grib_yyvaluep) { YYFPRINTF (grib_yyo, "%s %s (", - grib_yytype < YYNTOKENS ? "token" : "nterm", grib_yytname[grib_yytype]); + grib_yykind < YYNTOKENS ? "token" : "nterm", grib_yysymbol_name (grib_yykind)); - grib_yy_symbol_value_print (grib_yyo, grib_yytype, grib_yyvaluep); + grib_yy_symbol_value_print (grib_yyo, grib_yykind, grib_yyvaluep); YYFPRINTF (grib_yyo, ")"); } @@ -1806,7 +2017,8 @@ do { \ `------------------------------------------------*/ static void -grib_yy_reduce_print (grib_yy_state_t *grib_yyssp, YYSTYPE *grib_yyvsp, int grib_yyrule) +grib_yy_reduce_print (grib_yy_state_t *grib_yyssp, YYSTYPE *grib_yyvsp, + int grib_yyrule) { int grib_yylno = grib_yyrline[grib_yyrule]; int grib_yynrhs = grib_yyr2[grib_yyrule]; @@ -1818,9 +2030,8 @@ grib_yy_reduce_print (grib_yy_state_t *grib_yyssp, YYSTYPE *grib_yyvsp, int grib { YYFPRINTF (stderr, " $%d = ", grib_yyi + 1); grib_yy_symbol_print (stderr, - grib_yystos[+grib_yyssp[grib_yyi + 1 - grib_yynrhs]], - &grib_yyvsp[(grib_yyi + 1) - (grib_yynrhs)] - ); + YY_ACCESSING_SYMBOL (+grib_yyssp[grib_yyi + 1 - grib_yynrhs]), + &grib_yyvsp[(grib_yyi + 1) - (grib_yynrhs)]); YYFPRINTF (stderr, "\n"); } } @@ -1835,8 +2046,8 @@ do { \ multiple parsers can coexist. */ int grib_yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -1859,259 +2070,30 @@ int grib_yydebug; #endif -#if YYERROR_VERBOSE - -# ifndef grib_yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define grib_yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else -/* Return the length of YYSTR. */ -static YYPTRDIFF_T -grib_yystrlen (const char *grib_yystr) -{ - YYPTRDIFF_T grib_yylen; - for (grib_yylen = 0; grib_yystr[grib_yylen]; grib_yylen++) - continue; - return grib_yylen; -} -# endif -# endif - -# ifndef grib_yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define grib_yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -grib_yystpcpy (char *grib_yydest, const char *grib_yysrc) -{ - char *grib_yyd = grib_yydest; - const char *grib_yys = grib_yysrc; - - while ((*grib_yyd++ = *grib_yys++) != '\0') - continue; - - return grib_yyd - 1; -} -# endif -# endif - -# ifndef grib_yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for grib_yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from grib_yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYPTRDIFF_T -grib_yytnamerr (char *grib_yyres, const char *grib_yystr) -{ - if (*grib_yystr == '"') - { - YYPTRDIFF_T grib_yyn = 0; - char const *grib_yyp = grib_yystr; - - for (;;) - switch (*++grib_yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++grib_yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (grib_yyres) - grib_yyres[grib_yyn] = *grib_yyp; - grib_yyn++; - break; - - case '"': - if (grib_yyres) - grib_yyres[grib_yyn] = '\0'; - return grib_yyn; - } - do_not_strip_quotes: ; - } - - if (grib_yyres) - return grib_yystpcpy (grib_yyres, grib_yystr) - grib_yyres; - else - return grib_yystrlen (grib_yystr); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -grib_yysyntax_error (YYPTRDIFF_T *grib_yymsg_alloc, char **grib_yymsg, - grib_yy_state_t *grib_yyssp, int grib_yytoken) -{ - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *grib_yyformat = YY_NULLPTR; - /* Arguments of grib_yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - char const *grib_yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Actual size of YYARG. */ - int grib_yycount = 0; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T grib_yysize = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in grib_yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated grib_yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (grib_yytoken != YYEMPTY) - { - int grib_yyn = grib_yypact[+*grib_yyssp]; - YYPTRDIFF_T grib_yysize0 = grib_yytnamerr (YY_NULLPTR, grib_yytname[grib_yytoken]); - grib_yysize = grib_yysize0; - grib_yyarg[grib_yycount++] = grib_yytname[grib_yytoken]; - if (!grib_yypact_value_is_default (grib_yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int grib_yyxbegin = grib_yyn < 0 ? -grib_yyn : 0; - /* Stay within bounds of both grib_yycheck and grib_yytname. */ - int grib_yychecklim = YYLAST - grib_yyn + 1; - int grib_yyxend = grib_yychecklim < YYNTOKENS ? grib_yychecklim : YYNTOKENS; - int grib_yyx; - - for (grib_yyx = grib_yyxbegin; grib_yyx < grib_yyxend; ++grib_yyx) - if (grib_yycheck[grib_yyx + grib_yyn] == grib_yyx && grib_yyx != YYTERROR - && !grib_yytable_value_is_error (grib_yytable[grib_yyx + grib_yyn])) - { - if (grib_yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - grib_yycount = 1; - grib_yysize = grib_yysize0; - break; - } - grib_yyarg[grib_yycount++] = grib_yytname[grib_yyx]; - { - YYPTRDIFF_T grib_yysize1 - = grib_yysize + grib_yytnamerr (YY_NULLPTR, grib_yytname[grib_yyx]); - if (grib_yysize <= grib_yysize1 && grib_yysize1 <= YYSTACK_ALLOC_MAXIMUM) - grib_yysize = grib_yysize1; - else - return 2; - } - } - } - } - - switch (grib_yycount) - { -# define YYCASE_(N, S) \ - case N: \ - grib_yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - { - /* Don't count the "%s"s in the final size, but reserve room for - the terminator. */ - YYPTRDIFF_T grib_yysize1 = grib_yysize + (grib_yystrlen (grib_yyformat) - 2 * grib_yycount) + 1; - if (grib_yysize <= grib_yysize1 && grib_yysize1 <= YYSTACK_ALLOC_MAXIMUM) - grib_yysize = grib_yysize1; - else - return 2; - } - if (*grib_yymsg_alloc < grib_yysize) - { - *grib_yymsg_alloc = 2 * grib_yysize; - if (! (grib_yysize <= *grib_yymsg_alloc - && *grib_yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *grib_yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - /* Avoid snprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *grib_yyp = *grib_yymsg; - int grib_yyi = 0; - while ((*grib_yyp = *grib_yyformat) != '\0') - if (*grib_yyp == '%' && grib_yyformat[1] == 's' && grib_yyi < grib_yycount) - { - grib_yyp += grib_yytnamerr (grib_yyp, grib_yyarg[grib_yyi++]); - grib_yyformat += 2; - } - else - { - ++grib_yyp; - ++grib_yyformat; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -grib_yydestruct (const char *grib_yymsg, int grib_yytype, YYSTYPE *grib_yyvaluep) +grib_yydestruct (const char *grib_yymsg, + grib_yysymbol_kind_t grib_yykind, YYSTYPE *grib_yyvaluep) { - YYUSE (grib_yyvaluep); + YY_USE (grib_yyvaluep); if (!grib_yymsg) grib_yymsg = "Deleting"; - YY_SYMBOL_PRINT (grib_yymsg, grib_yytype, grib_yyvaluep, grib_yylocationp); + YY_SYMBOL_PRINT (grib_yymsg, grib_yykind, grib_yyvaluep, grib_yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (grib_yytype); + YY_USE (grib_yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } - - -/* The lookahead symbol. */ +/* Lookahead token kind. */ int grib_yychar; /* The semantic value of the lookahead symbol. */ @@ -2120,6 +2102,8 @@ YYSTYPE grib_yylval; int grib_yynerrs; + + /*----------. | grib_yyparse. | `----------*/ @@ -2127,43 +2111,36 @@ int grib_yynerrs; int grib_yyparse (void) { - grib_yy_state_fast_t grib_yystate; + grib_yy_state_fast_t grib_yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int grib_yyerrstatus; + int grib_yyerrstatus = 0; - /* The stacks and their tools: - 'grib_yyss': related to states. - 'grib_yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow grib_yyoverflow + /* Refer to the stacks through separate pointers, to allow grib_yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ + /* Their size. */ + YYPTRDIFF_T grib_yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ grib_yy_state_t grib_yyssa[YYINITDEPTH]; - grib_yy_state_t *grib_yyss; - grib_yy_state_t *grib_yyssp; + grib_yy_state_t *grib_yyss = grib_yyssa; + grib_yy_state_t *grib_yyssp = grib_yyss; - /* The semantic value stack. */ + /* The semantic value stack: array, bottom, top. */ YYSTYPE grib_yyvsa[YYINITDEPTH]; - YYSTYPE *grib_yyvs; - YYSTYPE *grib_yyvsp; - - YYPTRDIFF_T grib_yystacksize; + YYSTYPE *grib_yyvs = grib_yyvsa; + YYSTYPE *grib_yyvsp = grib_yyvs; int grib_yyn; + /* The return value of grib_yyparse. */ int grib_yyresult; - /* Lookahead token as an internal (translated) token number. */ - int grib_yytoken = 0; + /* Lookahead symbol kind. */ + grib_yysymbol_kind_t grib_yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE grib_yyval; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char grib_yymsgbuf[128]; - char *grib_yymsg = grib_yymsgbuf; - YYPTRDIFF_T grib_yymsg_alloc = sizeof grib_yymsgbuf; -#endif + #define YYPOPSTACK(N) (grib_yyvsp -= (N), grib_yyssp -= (N)) @@ -2171,16 +2148,10 @@ grib_yyparse (void) Keep to zero when no symbol should be popped. */ int grib_yylen = 0; - grib_yyssp = grib_yyss = grib_yyssa; - grib_yyvsp = grib_yyvs = grib_yyvsa; - grib_yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - grib_yystate = 0; - grib_yyerrstatus = 0; - grib_yynerrs = 0; grib_yychar = YYEMPTY; /* Cause a token to be read. */ + goto grib_yysetstate; @@ -2202,10 +2173,11 @@ grib_yyparse (void) YY_IGNORE_USELESS_CAST_BEGIN *grib_yyssp = YY_CAST (grib_yy_state_t, grib_yystate); YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (grib_yyss, grib_yyssp); if (grib_yyss + grib_yystacksize - 1 <= grib_yyssp) #if !defined grib_yyoverflow && !defined YYSTACK_RELOCATE - goto grib_yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -2233,7 +2205,7 @@ grib_yyparse (void) # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= grib_yystacksize) - goto grib_yyexhaustedlab; + YYNOMEM; grib_yystacksize *= 2; if (YYMAXDEPTH < grib_yystacksize) grib_yystacksize = YYMAXDEPTH; @@ -2244,10 +2216,10 @@ grib_yyparse (void) YY_CAST (union grib_yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (grib_yystacksize)))); if (! grib_yyptr) - goto grib_yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (grib_yyss_alloc, grib_yyss); YYSTACK_RELOCATE (grib_yyvs_alloc, grib_yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (grib_yyss1 != grib_yyssa) YYSTACK_FREE (grib_yyss1); } @@ -2266,6 +2238,7 @@ grib_yyparse (void) } #endif /* !defined grib_yyoverflow && !defined YYSTACK_RELOCATE */ + if (grib_yystate == YYFINAL) YYACCEPT; @@ -2286,18 +2259,29 @@ grib_yyparse (void) /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (grib_yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); grib_yychar = grib_yylex (); } if (grib_yychar <= YYEOF) { - grib_yychar = grib_yytoken = YYEOF; + grib_yychar = YYEOF; + grib_yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (grib_yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + grib_yychar = YYUNDEF; + grib_yytoken = YYSYMBOL_YYerror; + goto grib_yyerrlab1; + } else { grib_yytoken = YYTRANSLATE (grib_yychar); @@ -2366,249 +2350,249 @@ grib_yyparse (void) YY_REDUCE_PRINT (grib_yyn); switch (grib_yyn) { - case 2: + case 2: /* all: empty */ #line 262 "griby.y" { grib_parser_all_actions = 0;grib_parser_concept=0; grib_parser_hash_array=0;grib_parser_rules=0; } -#line 2374 "y.tab.c" +#line 2358 "y.tab.c" break; - case 3: + case 3: /* all: concept_list */ #line 264 "griby.y" { grib_parser_concept = reverse_concept((grib_yyvsp[0].concept_value)); } -#line 2380 "y.tab.c" +#line 2364 "y.tab.c" break; - case 4: + case 4: /* all: hash_array_list */ #line 265 "griby.y" { grib_parser_hash_array = reverse_hash_array((grib_yyvsp[0].hash_array_value)); } -#line 2386 "y.tab.c" +#line 2370 "y.tab.c" break; - case 5: + case 5: /* all: instructions */ #line 266 "griby.y" { grib_parser_all_actions = (grib_yyvsp[0].act); } -#line 2392 "y.tab.c" +#line 2376 "y.tab.c" break; - case 6: + case 6: /* all: rules */ #line 267 "griby.y" { grib_parser_rules = (grib_yyvsp[0].rules); } -#line 2398 "y.tab.c" +#line 2382 "y.tab.c" break; - case 7: + case 7: /* all: error */ #line 269 "griby.y" { grib_parser_all_actions = 0; grib_parser_concept=0; grib_parser_hash_array=0; grib_parser_rules=0; } -#line 2405 "y.tab.c" +#line 2389 "y.tab.c" break; - case 9: + case 9: /* dvalues: FLOAT */ #line 276 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[0].dval));} -#line 2411 "y.tab.c" +#line 2395 "y.tab.c" break; - case 10: + case 10: /* dvalues: dvalues ',' FLOAT */ #line 277 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].dval));} -#line 2417 "y.tab.c" +#line 2401 "y.tab.c" break; - case 11: + case 11: /* dvalues: INTEGER */ #line 278 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[0].lval));} -#line 2423 "y.tab.c" +#line 2407 "y.tab.c" break; - case 12: + case 12: /* dvalues: dvalues ',' INTEGER */ #line 279 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].lval));} -#line 2429 "y.tab.c" +#line 2413 "y.tab.c" break; - case 13: + case 13: /* svalues: STRING */ #line 282 "griby.y" { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,0,(grib_yyvsp[0].str));} -#line 2435 "y.tab.c" +#line 2419 "y.tab.c" break; - case 14: + case 14: /* svalues: svalues ',' STRING */ #line 283 "griby.y" { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,(grib_yyvsp[-2].svalue),(grib_yyvsp[0].str));} -#line 2441 "y.tab.c" +#line 2425 "y.tab.c" break; - case 15: + case 15: /* integer_array: INTEGER */ #line 287 "griby.y" { (grib_yyval.ivalue)=grib_iarray_push(0,(grib_yyvsp[0].lval));} -#line 2447 "y.tab.c" +#line 2431 "y.tab.c" break; - case 16: + case 16: /* integer_array: integer_array ',' INTEGER */ #line 288 "griby.y" { (grib_yyval.ivalue)=grib_iarray_push((grib_yyvsp[-2].ivalue),(grib_yyvsp[0].lval));} -#line 2453 "y.tab.c" +#line 2437 "y.tab.c" break; - case 18: + case 18: /* instructions: instruction instructions */ #line 292 "griby.y" { (grib_yyvsp[-1].act)->next = (grib_yyvsp[0].act); (grib_yyval.act) = (grib_yyvsp[-1].act); } -#line 2459 "y.tab.c" +#line 2443 "y.tab.c" break; - case 19: + case 19: /* instructions: instruction ';' instructions */ #line 293 "griby.y" { (grib_yyvsp[-2].act)->next = (grib_yyvsp[0].act); (grib_yyval.act) = (grib_yyvsp[-2].act); } -#line 2465 "y.tab.c" +#line 2449 "y.tab.c" break; - case 20: + case 20: /* instructions: instruction ';' */ #line 294 "griby.y" { (grib_yyval.act) = (grib_yyvsp[-1].act);} -#line 2471 "y.tab.c" +#line 2455 "y.tab.c" break; - case 32: + case 32: /* argument_list: empty */ #line 313 "griby.y" { (grib_yyval.explist) = 0; } -#line 2477 "y.tab.c" +#line 2461 "y.tab.c" break; - case 35: + case 35: /* arguments: argument ',' arguments */ #line 318 "griby.y" { (grib_yyvsp[-2].explist)->next = (grib_yyvsp[0].explist); (grib_yyval.explist) = (grib_yyvsp[-2].explist); } -#line 2483 "y.tab.c" +#line 2467 "y.tab.c" break; - case 36: + case 36: /* argument: expression */ #line 321 "griby.y" { (grib_yyval.explist) = grib_arguments_new(grib_parser_context,(grib_yyvsp[0].exp),NULL); } -#line 2489 "y.tab.c" +#line 2473 "y.tab.c" break; - case 37: + case 37: /* simple: UNSIGNED '[' INTEGER ']' IDENT default flags */ #line 326 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"unsigned",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2495 "y.tab.c" +#line 2479 "y.tab.c" break; - case 38: + case 38: /* simple: UNSIGNED '[' INTEGER ']' IDENT '[' argument_list ']' default flags */ #line 329 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"unsigned",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2501 "y.tab.c" +#line 2485 "y.tab.c" break; - case 39: + case 39: /* simple: UNSIGNED '(' INTEGER ')' IDENT default flags */ #line 332 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"unsigned_bits",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2507 "y.tab.c" +#line 2491 "y.tab.c" break; - case 40: + case 40: /* simple: UNSIGNED '(' INTEGER ')' IDENT '[' argument_list ']' default flags */ #line 335 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"unsigned_bits",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2513 "y.tab.c" +#line 2497 "y.tab.c" break; - case 41: + case 41: /* simple: ASCII '[' INTEGER ']' IDENT default flags */ #line 338 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ascii",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2519 "y.tab.c" +#line 2503 "y.tab.c" break; - case 42: + case 42: /* simple: GROUP IDENT default flags */ #line 341 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"group",0,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2525 "y.tab.c" +#line 2509 "y.tab.c" break; - case 43: + case 43: /* simple: GROUP IDENT '(' argument_list ')' default flags */ #line 344 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"group",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2531 "y.tab.c" +#line 2515 "y.tab.c" break; - case 44: + case 44: /* simple: IDENT '=' TO_INTEGER '(' argument_list ')' flags */ #line 347 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-6].str),"to_integer",0,(grib_yyvsp[-2].explist),0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-6].str)); } -#line 2537 "y.tab.c" +#line 2521 "y.tab.c" break; - case 45: + case 45: /* simple: IDENT '=' SEX2DEC '(' argument_list ')' flags */ #line 350 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-6].str),"sexagesimal2decimal",0,(grib_yyvsp[-2].explist),0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-6].str)); } -#line 2543 "y.tab.c" +#line 2527 "y.tab.c" break; - case 46: + case 46: /* simple: IDENT '=' TO_STRING '(' argument_list ')' flags */ #line 353 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-6].str),"to_string",0,(grib_yyvsp[-2].explist),0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-6].str)); } -#line 2549 "y.tab.c" +#line 2533 "y.tab.c" break; - case 47: + case 47: /* simple: NON_ALPHA IDENT default flags */ #line 356 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"non_alpha",0,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2555 "y.tab.c" +#line 2539 "y.tab.c" break; - case 48: + case 48: /* simple: ASCII '[' INTEGER ']' STRING default flags */ #line 360 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ascii",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2561 "y.tab.c" +#line 2545 "y.tab.c" break; - case 49: + case 49: /* simple: BYTE '[' INTEGER ']' IDENT default flags */ #line 363 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"bytes",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2567 "y.tab.c" +#line 2551 "y.tab.c" break; - case 50: + case 50: /* simple: BYTE '[' INTEGER ']' IDENT '[' argument_list ']' default flags */ #line 366 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"bytes",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2573 "y.tab.c" +#line 2557 "y.tab.c" break; - case 51: + case 51: /* simple: KSEC1EXPVER '[' INTEGER ']' IDENT default flags */ #line 369 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ksec1expver",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2579 "y.tab.c" +#line 2563 "y.tab.c" break; - case 52: + case 52: /* simple: SIGNED '[' INTEGER ']' IDENT default flags */ #line 372 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"signed",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2585 "y.tab.c" +#line 2569 "y.tab.c" break; - case 53: + case 53: /* simple: SIGNED '[' INTEGER ']' IDENT '[' argument_list ']' default flags */ #line 375 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"signed",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2591 "y.tab.c" +#line 2575 "y.tab.c" break; - case 54: + case 54: /* simple: SIGNED '(' INTEGER ')' IDENT default flags */ #line 378 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"signed_bits",(grib_yyvsp[-4].lval),NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2597 "y.tab.c" +#line 2581 "y.tab.c" break; - case 55: + case 55: /* simple: SIGNED '(' INTEGER ')' IDENT '[' argument_list ']' default flags */ #line 381 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"signed_bits",(grib_yyvsp[-7].lval),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2603 "y.tab.c" +#line 2587 "y.tab.c" break; - case 56: + case 56: /* simple: CODETABLE '[' INTEGER ']' IDENT argument default flags */ #line 384 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"codetable",(grib_yyvsp[-5].lval), (grib_yyvsp[-2].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2609 "y.tab.c" +#line 2593 "y.tab.c" break; - case 57: + case 57: /* simple: CODETABLE '[' IDENT ']' IDENT argument default flags */ #line 387 "griby.y" { /* ECC-485: Set length to 0 and prepend the new argument */ @@ -2619,357 +2603,357 @@ grib_yyparse (void) (grib_yyvsp[-1].explist), (grib_yyvsp[0].lval), NULL, NULL); free((grib_yyvsp[-3].str)); } -#line 2623 "y.tab.c" +#line 2607 "y.tab.c" break; - case 58: + case 58: /* simple: CODETABLE '[' INTEGER ']' IDENT argument default SET '(' IDENT ')' flags */ #line 398 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-7].str),"codetable",(grib_yyvsp[-9].lval), (grib_yyvsp[-6].explist),(grib_yyvsp[-5].explist),(grib_yyvsp[0].lval),NULL,(grib_yyvsp[-2].str)); free((grib_yyvsp[-7].str));free((grib_yyvsp[-2].str)); } -#line 2630 "y.tab.c" +#line 2614 "y.tab.c" break; - case 59: + case 59: /* simple: CODETABLE '[' INTEGER ']' IDENT '(' argument_list ')' default flags */ #line 402 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"codetable",(grib_yyvsp[-7].lval), (grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2636 "y.tab.c" +#line 2620 "y.tab.c" break; - case 60: + case 60: /* simple: SMART_TABLE IDENT '(' argument_list ')' default flags */ #line 405 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"smart_table",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2642 "y.tab.c" +#line 2626 "y.tab.c" break; - case 61: + case 61: /* simple: IDENT '=' DICTIONARY '(' argument_list ')' default flags */ #line 408 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-7].str),"dictionary",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-7].str)); } -#line 2648 "y.tab.c" +#line 2632 "y.tab.c" break; - case 62: + case 62: /* simple: IDENT '=' GETENV '(' argument_list ')' default flags */ #line 411 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-7].str),"getenv",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-7].str)); } -#line 2654 "y.tab.c" +#line 2638 "y.tab.c" break; - case 63: + case 63: /* simple: COMPLEX_CODETABLE '[' INTEGER ']' IDENT argument default flags */ #line 414 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"complex_codetable",(grib_yyvsp[-5].lval), (grib_yyvsp[-2].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2660 "y.tab.c" +#line 2644 "y.tab.c" break; - case 64: + case 64: /* simple: COMPLEX_CODETABLE '[' INTEGER ']' IDENT '(' argument_list ')' default flags */ #line 417 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"complex_codetable",(grib_yyvsp[-7].lval), (grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2666 "y.tab.c" +#line 2650 "y.tab.c" break; - case 65: + case 65: /* simple: FLAG '[' INTEGER ']' IDENT argument default flags */ #line 420 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"codeflag",(grib_yyvsp[-5].lval), (grib_yyvsp[-2].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2672 "y.tab.c" +#line 2656 "y.tab.c" break; - case 66: + case 66: /* simple: LOOKUP '[' INTEGER ']' IDENT '(' argument_list ')' flags */ #line 423 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-4].str),"lookup",(grib_yyvsp[-6].lval),(grib_yyvsp[-2].explist),NULL,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-4].str)); } -#line 2678 "y.tab.c" +#line 2662 "y.tab.c" break; - case 67: + case 67: /* simple: FLAGBIT IDENT '(' argument_list ')' default flags */ #line 426 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"bit",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2684 "y.tab.c" +#line 2668 "y.tab.c" break; - case 68: + case 68: /* simple: LABEL IDENT */ #line 429 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"label",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[0].str)); } -#line 2690 "y.tab.c" +#line 2674 "y.tab.c" break; - case 69: + case 69: /* simple: LABEL STRING */ #line 432 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"label",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[0].str)); } -#line 2696 "y.tab.c" +#line 2680 "y.tab.c" break; - case 70: + case 70: /* simple: IBMFLOAT IDENT default flags */ #line 435 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ibmfloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2702 "y.tab.c" +#line 2686 "y.tab.c" break; - case 71: + case 71: /* simple: INT8 IDENT default flags */ #line 439 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int8",1,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2708 "y.tab.c" +#line 2692 "y.tab.c" break; - case 72: + case 72: /* simple: UINT8 IDENT default flags */ #line 442 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint8",1,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2714 "y.tab.c" +#line 2698 "y.tab.c" break; - case 73: + case 73: /* simple: INT16 IDENT default flags */ #line 445 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int16",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2720 "y.tab.c" +#line 2704 "y.tab.c" break; - case 74: + case 74: /* simple: UINT16 IDENT default flags */ #line 448 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint16",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2726 "y.tab.c" +#line 2710 "y.tab.c" break; - case 75: + case 75: /* simple: INT16_LITTLE_ENDIAN IDENT default flags */ #line 451 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int16_little_endian",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2732 "y.tab.c" +#line 2716 "y.tab.c" break; - case 76: + case 76: /* simple: UINT16_LITTLE_ENDIAN IDENT default flags */ #line 454 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint16_little_endian",2,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2738 "y.tab.c" +#line 2722 "y.tab.c" break; - case 77: + case 77: /* simple: INT32 IDENT default flags */ #line 457 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int32",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2744 "y.tab.c" +#line 2728 "y.tab.c" break; - case 78: + case 78: /* simple: UINT32 IDENT default flags */ #line 460 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint32",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2750 "y.tab.c" +#line 2734 "y.tab.c" break; - case 79: + case 79: /* simple: INT32_LITTLE_ENDIAN IDENT default flags */ #line 463 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int32_little_endian",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2756 "y.tab.c" +#line 2740 "y.tab.c" break; - case 80: + case 80: /* simple: UINT32_LITTLE_ENDIAN IDENT default flags */ #line 466 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint32_little_endian",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2762 "y.tab.c" +#line 2746 "y.tab.c" break; - case 81: + case 81: /* simple: INT64 IDENT default flags */ #line 469 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int64",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2768 "y.tab.c" +#line 2752 "y.tab.c" break; - case 82: + case 82: /* simple: UINT64 IDENT default flags */ #line 472 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint64",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2774 "y.tab.c" +#line 2758 "y.tab.c" break; - case 83: + case 83: /* simple: INT64_LITTLE_ENDIAN IDENT default flags */ #line 475 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"int64_little_endian",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2780 "y.tab.c" +#line 2764 "y.tab.c" break; - case 84: + case 84: /* simple: UINT64_LITTLE_ENDIAN IDENT default flags */ #line 478 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"uint64_little_endian",8,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-2].str)); } -#line 2786 "y.tab.c" +#line 2770 "y.tab.c" break; - case 85: + case 85: /* simple: BLOB IDENT '[' argument_list ']' default flags */ #line 481 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"blob",0,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-5].str)); } -#line 2792 "y.tab.c" +#line 2776 "y.tab.c" break; - case 86: + case 86: /* simple: IBMFLOAT IDENT '.' IDENT default flags */ #line 485 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ibmfloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),(grib_yyvsp[-4].str),NULL);free((grib_yyvsp[-2].str)); free((grib_yyvsp[-4].str)); } -#line 2798 "y.tab.c" +#line 2782 "y.tab.c" break; - case 87: + case 87: /* simple: IBMFLOAT IDENT '[' argument ']' default flags */ #line 488 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"ibmfloat",4,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-5].str)); } -#line 2804 "y.tab.c" +#line 2788 "y.tab.c" break; - case 88: + case 88: /* simple: POS IDENT */ #line 491 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"position",0,NULL,NULL,0,NULL,NULL); free((grib_yyvsp[0].str)); } -#line 2810 "y.tab.c" +#line 2794 "y.tab.c" break; - case 89: + case 89: /* simple: INTCONST IDENT '=' argument flags */ #line 494 "griby.y" { (grib_yyval.act) = grib_action_create_variable(grib_parser_context,(grib_yyvsp[-3].str),"constant",0,(grib_yyvsp[-1].explist),NULL,(grib_yyvsp[0].lval),NULL);free((grib_yyvsp[-3].str)); } -#line 2816 "y.tab.c" +#line 2800 "y.tab.c" break; - case 90: + case 90: /* simple: TRANS IDENT '=' argument flags */ #line 497 "griby.y" { (grib_yyval.act) = grib_action_create_variable(grib_parser_context,(grib_yyvsp[-3].str),"transient",0,(grib_yyvsp[-1].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL); free((grib_yyvsp[-3].str)); } -#line 2822 "y.tab.c" +#line 2806 "y.tab.c" break; - case 91: + case 91: /* simple: TRANS IDENT '=' '{' dvalues '}' flags */ #line 499 "griby.y" { (grib_yyval.act) = grib_action_create_transient_darray(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].lval)); free((grib_yyvsp[-5].str)); } -#line 2828 "y.tab.c" +#line 2812 "y.tab.c" break; - case 92: + case 92: /* simple: FLOAT IDENT default flags */ #line 502 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ieeefloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-2].str)); } -#line 2834 "y.tab.c" +#line 2818 "y.tab.c" break; - case 93: + case 93: /* simple: FLOAT IDENT '.' IDENT default flags */ #line 505 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-2].str),"ieeefloat",4,NULL,(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),(grib_yyvsp[-4].str),NULL); free((grib_yyvsp[-2].str));free((grib_yyvsp[-4].str));} -#line 2840 "y.tab.c" +#line 2824 "y.tab.c" break; - case 94: + case 94: /* simple: FLOAT IDENT '[' argument ']' default flags */ #line 508 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-5].str),"ieeefloat",4,(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL,NULL);free((grib_yyvsp[-5].str)); } -#line 2846 "y.tab.c" +#line 2830 "y.tab.c" break; - case 95: + case 95: /* simple: G1_HALF_BYTE IDENT */ #line 511 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[0].str),"g1_half_byte_codeflag",0,NULL,NULL,0,NULL,NULL);free((grib_yyvsp[0].str)); } -#line 2852 "y.tab.c" +#line 2836 "y.tab.c" break; - case 96: + case 96: /* simple: SECTION_LENGTH '[' INTEGER ']' IDENT default */ #line 514 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"section_length",(grib_yyvsp[-3].lval),NULL,(grib_yyvsp[0].explist),0,NULL,NULL);free((grib_yyvsp[-1].str)); } -#line 2858 "y.tab.c" +#line 2842 "y.tab.c" break; - case 97: + case 97: /* simple: G1_MESSAGE_LENGTH '[' INTEGER ']' IDENT '(' argument_list ')' */ #line 517 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"g1_message_length",(grib_yyvsp[-5].lval),(grib_yyvsp[-1].explist),NULL,0,NULL,NULL);free((grib_yyvsp[-3].str)); } -#line 2864 "y.tab.c" +#line 2848 "y.tab.c" break; - case 98: + case 98: /* simple: G1_SECTION4_LENGTH '[' INTEGER ']' IDENT '(' argument_list ')' */ #line 520 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"g1_section4_length",(grib_yyvsp[-5].lval),(grib_yyvsp[-1].explist),NULL,0,NULL,NULL);free((grib_yyvsp[-3].str)); } -#line 2870 "y.tab.c" +#line 2854 "y.tab.c" break; - case 99: + case 99: /* simple: KSEC IDENT argument */ #line 523 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"ksec",0,(grib_yyvsp[0].explist),NULL,0,NULL,NULL);free((grib_yyvsp[-1].str)); } -#line 2876 "y.tab.c" +#line 2860 "y.tab.c" break; - case 100: + case 100: /* simple: PAD IDENT '(' argument_list ')' */ #line 526 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"pad",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2882 "y.tab.c" +#line 2866 "y.tab.c" break; - case 101: + case 101: /* simple: PADTO IDENT '(' argument_list ')' */ #line 529 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"padto",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2888 "y.tab.c" +#line 2872 "y.tab.c" break; - case 102: + case 102: /* simple: PADTOEVEN IDENT '(' argument_list ')' */ #line 532 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"padtoeven",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2894 "y.tab.c" +#line 2878 "y.tab.c" break; - case 103: + case 103: /* simple: PADTOMULTIPLE IDENT '(' argument_list ')' */ #line 535 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-3].str),"padtomultiple",0,(grib_yyvsp[-1].explist),0,0,NULL,NULL); free((grib_yyvsp[-3].str)); } -#line 2900 "y.tab.c" +#line 2884 "y.tab.c" break; - case 104: + case 104: /* simple: MESSAGE '[' INTEGER ']' IDENT flags */ #line 538 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"message",(grib_yyvsp[-3].lval),0,0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-1].str)); } -#line 2906 "y.tab.c" +#line 2890 "y.tab.c" break; - case 105: + case 105: /* simple: MESSAGE_COPY IDENT flags */ #line 541 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"message_copy",0,0,0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-1].str)); } -#line 2912 "y.tab.c" +#line 2896 "y.tab.c" break; - case 106: + case 106: /* simple: SECTION_PADDING IDENT flags */ #line 544 "griby.y" { (grib_yyval.act) = grib_action_create_gen(grib_parser_context,(grib_yyvsp[-1].str),"section_padding",0,0,0,(grib_yyvsp[0].lval),NULL,NULL); free((grib_yyvsp[-1].str)); } -#line 2918 "y.tab.c" +#line 2902 "y.tab.c" break; - case 107: + case 107: /* simple: TEMPLATE IDENT STRING */ #line 546 "griby.y" { (grib_yyval.act) = grib_action_create_template(grib_parser_context,0,(grib_yyvsp[-1].str),(grib_yyvsp[0].str)); free((grib_yyvsp[-1].str)); free((grib_yyvsp[0].str));} -#line 2924 "y.tab.c" +#line 2908 "y.tab.c" break; - case 108: + case 108: /* simple: TEMPLATE_NOFAIL IDENT STRING */ #line 548 "griby.y" { (grib_yyval.act) = grib_action_create_template(grib_parser_context,1,(grib_yyvsp[-1].str),(grib_yyvsp[0].str)); free((grib_yyvsp[-1].str)); free((grib_yyvsp[0].str));} -#line 2930 "y.tab.c" +#line 2914 "y.tab.c" break; - case 109: + case 109: /* simple: ALIAS IDENT '=' IDENT flags */ #line 551 "griby.y" { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str),NULL,(grib_yyvsp[0].lval)); free((grib_yyvsp[-3].str)); free((grib_yyvsp[-1].str)); } -#line 2936 "y.tab.c" +#line 2920 "y.tab.c" break; - case 110: + case 110: /* simple: UNALIAS IDENT */ #line 554 "griby.y" { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[0].str),NULL,NULL,0); free((grib_yyvsp[0].str)); } -#line 2942 "y.tab.c" +#line 2926 "y.tab.c" break; - case 111: + case 111: /* simple: ALIAS IDENT '.' IDENT '=' IDENT flags */ #line 557 "griby.y" { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str),(grib_yyvsp[-5].str),(grib_yyvsp[0].lval)); free((grib_yyvsp[-5].str)); free((grib_yyvsp[-3].str)); free((grib_yyvsp[-1].str)); } -#line 2950 "y.tab.c" +#line 2934 "y.tab.c" break; - case 112: + case 112: /* simple: UNALIAS IDENT '.' IDENT */ #line 561 "griby.y" { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[0].str),NULL,(grib_yyvsp[-2].str),0); free((grib_yyvsp[-2].str)); free((grib_yyvsp[0].str)); } -#line 2958 "y.tab.c" +#line 2942 "y.tab.c" break; - case 113: + case 113: /* simple: META IDENT IDENT '(' argument_list ')' default flags */ #line 565 "griby.y" { (grib_yyval.act) = grib_action_create_meta(grib_parser_context,(grib_yyvsp[-6].str),(grib_yyvsp[-5].str),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),NULL); free((grib_yyvsp[-6].str));free((grib_yyvsp[-5].str));} -#line 2964 "y.tab.c" +#line 2948 "y.tab.c" break; - case 114: + case 114: /* simple: META IDENT '.' IDENT IDENT '(' argument_list ')' default flags */ #line 568 "griby.y" { (grib_yyval.act) = grib_action_create_meta(grib_parser_context,(grib_yyvsp[-6].str),(grib_yyvsp[-5].str),(grib_yyvsp[-3].explist),(grib_yyvsp[-1].explist),(grib_yyvsp[0].lval),(grib_yyvsp[-8].str)); free((grib_yyvsp[-6].str));free((grib_yyvsp[-5].str));free((grib_yyvsp[-8].str));} -#line 2970 "y.tab.c" +#line 2954 "y.tab.c" break; - case 115: + case 115: /* simple: ITERATOR IDENT '(' argument_list ')' */ #line 571 "griby.y" { grib_arguments* a = grib_arguments_new( @@ -2982,10 +2966,10 @@ grib_yyparse (void) "ITERATOR","iterator",a,NULL, GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } -#line 2986 "y.tab.c" +#line 2970 "y.tab.c" break; - case 116: + case 116: /* simple: NEAREST IDENT '(' argument_list ')' */ #line 583 "griby.y" { grib_arguments* a = grib_arguments_new( @@ -2998,10 +2982,10 @@ grib_yyparse (void) "NEAREST","nearest",a,NULL, GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } -#line 3002 "y.tab.c" +#line 2986 "y.tab.c" break; - case 117: + case 117: /* simple: BOX IDENT '(' argument_list ')' */ #line 595 "griby.y" { grib_arguments* a = grib_arguments_new( @@ -3014,809 +2998,809 @@ grib_yyparse (void) "BOX","box",a,NULL, GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } -#line 3018 "y.tab.c" +#line 3002 "y.tab.c" break; - case 118: + case 118: /* simple: EXPORT IDENT '(' argument_list ')' */ #line 607 "griby.y" { (grib_yyval.act) = grib_action_create_put(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist));free((grib_yyvsp[-3].str));} -#line 3024 "y.tab.c" +#line 3008 "y.tab.c" break; - case 119: + case 119: /* simple: REMOVE argument_list */ #line 610 "griby.y" { (grib_yyval.act) = grib_action_create_remove(grib_parser_context,(grib_yyvsp[0].explist));} -#line 3030 "y.tab.c" +#line 3014 "y.tab.c" break; - case 120: + case 120: /* simple: RENAME '(' IDENT ',' IDENT ')' */ #line 612 "griby.y" { (grib_yyval.act) = grib_action_create_rename(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str));free((grib_yyvsp[-3].str));free((grib_yyvsp[-1].str));} -#line 3036 "y.tab.c" +#line 3020 "y.tab.c" break; - case 121: + case 121: /* simple: ASSERT '(' expression ')' */ #line 615 "griby.y" { (grib_yyval.act) = grib_action_create_assert(grib_parser_context,(grib_yyvsp[-1].exp));} -#line 3042 "y.tab.c" +#line 3026 "y.tab.c" break; - case 122: + case 122: /* simple: MODIFY IDENT flags */ #line 618 "griby.y" { (grib_yyval.act) = grib_action_create_modify(grib_parser_context,(grib_yyvsp[-1].str),(grib_yyvsp[0].lval)); free((grib_yyvsp[-1].str));} -#line 3048 "y.tab.c" +#line 3032 "y.tab.c" break; - case 123: + case 123: /* simple: SET IDENT '=' MISSING */ #line 620 "griby.y" { (grib_yyval.act) = grib_action_create_set_missing(grib_parser_context,(grib_yyvsp[-2].str)); free((grib_yyvsp[-2].str)); } -#line 3054 "y.tab.c" +#line 3038 "y.tab.c" break; - case 124: + case 124: /* simple: SET IDENT '=' expression */ #line 621 "griby.y" { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),0); free((grib_yyvsp[-2].str)); } -#line 3060 "y.tab.c" +#line 3044 "y.tab.c" break; - case 125: + case 125: /* simple: SET IDENT '=' '{' dvalues '}' */ #line 622 "griby.y" { (grib_yyval.act) = grib_action_create_set_darray(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].dvalue)); free((grib_yyvsp[-4].str)); } -#line 3066 "y.tab.c" +#line 3050 "y.tab.c" break; - case 126: + case 126: /* simple: SET IDENT '=' '{' svalues '}' */ #line 623 "griby.y" { (grib_yyval.act) = grib_action_create_set_sarray(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].svalue)); free((grib_yyvsp[-4].str)); } -#line 3072 "y.tab.c" +#line 3056 "y.tab.c" break; - case 127: + case 127: /* simple: SET_NOFAIL IDENT '=' expression */ #line 625 "griby.y" { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),1); free((grib_yyvsp[-2].str)); } -#line 3078 "y.tab.c" +#line 3062 "y.tab.c" break; - case 128: + case 128: /* simple: WRITE STRING */ #line 628 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),0,0); free((grib_yyvsp[0].str));} -#line 3084 "y.tab.c" +#line 3068 "y.tab.c" break; - case 129: + case 129: /* simple: WRITE */ #line 629 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,0); } -#line 3090 "y.tab.c" +#line 3074 "y.tab.c" break; - case 130: + case 130: /* simple: WRITE '(' INTEGER ')' STRING */ #line 630 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),0,(grib_yyvsp[-2].lval)); free((grib_yyvsp[0].str));} -#line 3096 "y.tab.c" +#line 3080 "y.tab.c" break; - case 131: + case 131: /* simple: WRITE '(' INTEGER ')' */ #line 631 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,(grib_yyvsp[-1].lval)); } -#line 3102 "y.tab.c" +#line 3086 "y.tab.c" break; - case 132: + case 132: /* simple: APPEND STRING */ #line 632 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),1,0); free((grib_yyvsp[0].str));} -#line 3108 "y.tab.c" +#line 3092 "y.tab.c" break; - case 133: + case 133: /* simple: APPEND */ #line 633 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,0); } -#line 3114 "y.tab.c" +#line 3098 "y.tab.c" break; - case 134: + case 134: /* simple: APPEND '(' INTEGER ')' STRING */ #line 634 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),1,(grib_yyvsp[-2].lval)); free((grib_yyvsp[0].str));} -#line 3120 "y.tab.c" +#line 3104 "y.tab.c" break; - case 135: + case 135: /* simple: APPEND '(' INTEGER ')' */ #line 635 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,(grib_yyvsp[-1].lval)); } -#line 3126 "y.tab.c" +#line 3110 "y.tab.c" break; - case 136: + case 136: /* simple: CLOSE '(' IDENT ')' */ #line 637 "griby.y" { (grib_yyval.act) = grib_action_create_close(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} -#line 3132 "y.tab.c" +#line 3116 "y.tab.c" break; - case 137: + case 137: /* simple: PRINT STRING */ #line 638 "griby.y" { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),0); free((grib_yyvsp[0].str)); } -#line 3138 "y.tab.c" +#line 3122 "y.tab.c" break; - case 138: + case 138: /* simple: PRINT '(' STRING ')' STRING */ #line 639 "griby.y" { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),(grib_yyvsp[-2].str)); free((grib_yyvsp[0].str)); free((grib_yyvsp[-2].str));} -#line 3144 "y.tab.c" +#line 3128 "y.tab.c" break; - case 139: + case 139: /* simple: PRINT '(' IDENT ')' STRING */ #line 640 "griby.y" { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),(grib_yyvsp[-2].str)); free((grib_yyvsp[0].str)); free((grib_yyvsp[-2].str));} -#line 3150 "y.tab.c" +#line 3134 "y.tab.c" break; - case 140: + case 140: /* simple: PRINT */ #line 641 "griby.y" { (grib_yyval.act) = grib_action_create_print(grib_parser_context,"",0); } -#line 3156 "y.tab.c" +#line 3140 "y.tab.c" break; - case 141: + case 141: /* if_block: IF '(' expression ')' '{' instructions '}' */ #line 645 "griby.y" { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),0,0,grib_yylineno,file_being_parsed()); } -#line 3162 "y.tab.c" +#line 3146 "y.tab.c" break; - case 142: + case 142: /* if_block: IF '(' expression ')' '{' instructions '}' ELSE '{' instructions '}' */ #line 646 "griby.y" { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act),0,grib_yylineno,file_being_parsed()); } -#line 3168 "y.tab.c" +#line 3152 "y.tab.c" break; - case 143: + case 143: /* if_block: IF_TRANSIENT '(' expression ')' '{' instructions '}' */ #line 647 "griby.y" { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),0,1,grib_yylineno,file_being_parsed()); } -#line 3174 "y.tab.c" +#line 3158 "y.tab.c" break; - case 144: + case 144: /* if_block: IF_TRANSIENT '(' expression ')' '{' instructions '}' ELSE '{' instructions '}' */ #line 648 "griby.y" { (grib_yyval.act) = grib_action_create_if(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act),1,grib_yylineno,file_being_parsed()); } -#line 3180 "y.tab.c" +#line 3164 "y.tab.c" break; - case 145: + case 145: /* when_block: WHEN '(' expression ')' set semi */ #line 652 "griby.y" { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-3].exp),(grib_yyvsp[-1].act),NULL); } -#line 3186 "y.tab.c" +#line 3170 "y.tab.c" break; - case 146: + case 146: /* when_block: WHEN '(' expression ')' '{' set_list '}' */ #line 653 "griby.y" { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),NULL); } -#line 3192 "y.tab.c" +#line 3176 "y.tab.c" break; - case 147: + case 147: /* when_block: WHEN '(' expression ')' '{' set_list '}' ELSE '{' set_list '}' */ #line 654 "griby.y" { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act)); } -#line 3198 "y.tab.c" +#line 3182 "y.tab.c" break; - case 148: + case 148: /* set: SET IDENT '=' expression */ #line 657 "griby.y" { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),0); free((grib_yyvsp[-2].str)); } -#line 3204 "y.tab.c" +#line 3188 "y.tab.c" break; - case 149: + case 149: /* set: SET_NOFAIL IDENT '=' expression */ #line 658 "griby.y" { (grib_yyval.act) = grib_action_create_set(grib_parser_context,(grib_yyvsp[-2].str),(grib_yyvsp[0].exp),1); free((grib_yyvsp[-2].str)); } -#line 3210 "y.tab.c" +#line 3194 "y.tab.c" break; - case 151: + case 151: /* set_list: set_list set semi */ #line 662 "griby.y" { (grib_yyvsp[-2].act)->next = (grib_yyvsp[-1].act); (grib_yyval.act) = (grib_yyvsp[-2].act); } -#line 3216 "y.tab.c" +#line 3200 "y.tab.c" break; - case 152: + case 152: /* default: empty */ #line 666 "griby.y" { (grib_yyval.explist) = NULL ;} -#line 3222 "y.tab.c" +#line 3206 "y.tab.c" break; - case 153: + case 153: /* default: '=' argument_list */ #line 667 "griby.y" { (grib_yyval.explist) = (grib_yyvsp[0].explist) ;} -#line 3228 "y.tab.c" +#line 3212 "y.tab.c" break; - case 154: + case 154: /* flags: empty */ #line 670 "griby.y" { (grib_yyval.lval) = 0 ; } -#line 3234 "y.tab.c" +#line 3218 "y.tab.c" break; - case 155: + case 155: /* flags: ':' flag_list */ #line 671 "griby.y" { (grib_yyval.lval) = (grib_yyvsp[0].lval); } -#line 3240 "y.tab.c" +#line 3224 "y.tab.c" break; - case 157: + case 157: /* flag_list: flag_list ',' flag */ #line 675 "griby.y" { (grib_yyval.lval) = (grib_yyvsp[-2].lval) | (grib_yyvsp[0].lval); } -#line 3246 "y.tab.c" +#line 3230 "y.tab.c" break; - case 158: + case 158: /* flag: READ_ONLY */ #line 678 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_READ_ONLY; } -#line 3252 "y.tab.c" +#line 3236 "y.tab.c" break; - case 159: + case 159: /* flag: LOWERCASE */ #line 679 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LOWERCASE; } -#line 3258 "y.tab.c" +#line 3242 "y.tab.c" break; - case 160: + case 160: /* flag: DUMP */ #line 680 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DUMP; } -#line 3264 "y.tab.c" +#line 3248 "y.tab.c" break; - case 161: + case 161: /* flag: NO_COPY */ #line 681 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_COPY; } -#line 3270 "y.tab.c" +#line 3254 "y.tab.c" break; - case 162: + case 162: /* flag: NO_FAIL */ #line 682 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_FAIL; } -#line 3276 "y.tab.c" +#line 3260 "y.tab.c" break; - case 163: + case 163: /* flag: HIDDEN */ #line 683 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_HIDDEN; } -#line 3282 "y.tab.c" +#line 3266 "y.tab.c" break; - case 164: + case 164: /* flag: EDITION_SPECIFIC */ #line 684 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -#line 3288 "y.tab.c" +#line 3272 "y.tab.c" break; - case 165: + case 165: /* flag: CAN_BE_MISSING */ #line 685 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; } -#line 3294 "y.tab.c" +#line 3278 "y.tab.c" break; - case 166: + case 166: /* flag: CONSTRAINT */ #line 686 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CONSTRAINT; } -#line 3300 "y.tab.c" +#line 3284 "y.tab.c" break; - case 167: + case 167: /* flag: COPY_OK */ #line 687 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_COPY_OK; } -#line 3306 "y.tab.c" +#line 3290 "y.tab.c" break; - case 168: + case 168: /* flag: TRANS */ #line 688 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_TRANSIENT; } -#line 3312 "y.tab.c" +#line 3296 "y.tab.c" break; - case 169: + case 169: /* flag: STRING_TYPE */ #line 689 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_STRING_TYPE; } -#line 3318 "y.tab.c" +#line 3302 "y.tab.c" break; - case 170: + case 170: /* flag: LONG_TYPE */ #line 690 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LONG_TYPE; } -#line 3324 "y.tab.c" +#line 3308 "y.tab.c" break; - case 171: + case 171: /* flag: DOUBLE_TYPE */ #line 691 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DOUBLE_TYPE; } -#line 3330 "y.tab.c" +#line 3314 "y.tab.c" break; - case 172: + case 172: /* list_block: IDENT LIST '(' expression ')' '{' instructions '}' */ #line 694 "griby.y" { (grib_yyval.act) = grib_action_create_list(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act)); free((grib_yyvsp[-7].str)); } -#line 3336 "y.tab.c" +#line 3320 "y.tab.c" break; - case 173: + case 173: /* while_block: WHILE '(' expression ')' '{' instructions '}' */ #line 697 "griby.y" { (grib_yyval.act) = grib_action_create_while(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act)); } -#line 3342 "y.tab.c" +#line 3326 "y.tab.c" break; - case 174: + case 174: /* trigger_block: TRIGGER '(' argument_list ')' '{' instructions '}' */ #line 700 "griby.y" { (grib_yyval.act) = grib_action_create_trigger(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].act)); } -#line 3348 "y.tab.c" +#line 3332 "y.tab.c" break; - case 175: + case 175: /* concept_block: CONCEPT IDENT '{' concept_list '}' flags */ #line 703 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,0,0,0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-4].str)); } -#line 3354 "y.tab.c" +#line 3338 "y.tab.c" break; - case 176: + case 176: /* concept_block: CONCEPT IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 704 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,0,(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } -#line 3360 "y.tab.c" +#line 3344 "y.tab.c" break; - case 177: + case 177: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 705 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),0,(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } -#line 3366 "y.tab.c" +#line 3350 "y.tab.c" break; - case 178: + case 178: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ',' IDENT ')' flags */ #line 706 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-12].str),0,(grib_yyvsp[-8].str),0,(grib_yyvsp[-10].str),(grib_yyvsp[-6].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),(grib_yyvsp[0].lval),0); free((grib_yyvsp[-12].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } -#line 3372 "y.tab.c" +#line 3356 "y.tab.c" break; - case 179: + case 179: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 707 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); } -#line 3378 "y.tab.c" +#line 3362 "y.tab.c" break; - case 180: + case 180: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 708 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-12].str),(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str)); free((grib_yyvsp[-2].str)); free((grib_yyvsp[-12].str));} -#line 3384 "y.tab.c" +#line 3368 "y.tab.c" break; - case 181: + case 181: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 709 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),(grib_yyvsp[-10].str),(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); free((grib_yyvsp[-10].str));} -#line 3390 "y.tab.c" +#line 3374 "y.tab.c" break; - case 182: + case 182: /* concept_block: CONCEPT IDENT '.' IDENT '{' concept_list '}' flags */ #line 710 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-6].str),0,0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-6].str));free((grib_yyvsp[-4].str)); } -#line 3396 "y.tab.c" +#line 3380 "y.tab.c" break; - case 183: + case 183: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 711 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-9].str),(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-9].str));free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } -#line 3402 "y.tab.c" +#line 3386 "y.tab.c" break; - case 184: + case 184: /* concept_block: CONCEPT_NOFAIL IDENT '{' concept_list '}' flags */ #line 712 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,0,0,0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-4].str)); } -#line 3408 "y.tab.c" +#line 3392 "y.tab.c" break; - case 185: + case 185: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 713 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,0,(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } -#line 3414 "y.tab.c" +#line 3398 "y.tab.c" break; - case 186: + case 186: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 714 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),0,(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } -#line 3420 "y.tab.c" +#line 3404 "y.tab.c" break; - case 187: + case 187: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 715 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); } -#line 3426 "y.tab.c" +#line 3410 "y.tab.c" break; - case 188: + case 188: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 716 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),(grib_yyvsp[-12].str),(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); free((grib_yyvsp[-12].str));} -#line 3432 "y.tab.c" +#line 3416 "y.tab.c" break; - case 189: + case 189: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 717 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-8].str),0,(grib_yyvsp[-4].str),(grib_yyvsp[-10].str),(grib_yyvsp[-6].str),(grib_yyvsp[-2].str),0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-2].str)); free((grib_yyvsp[-10].str));} -#line 3438 "y.tab.c" +#line 3422 "y.tab.c" break; - case 190: + case 190: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '{' concept_list '}' flags */ #line 718 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-6].str),0,0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-6].str));free((grib_yyvsp[-4].str)); } -#line 3444 "y.tab.c" +#line 3428 "y.tab.c" break; - case 191: + case 191: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 719 "griby.y" { (grib_yyval.act) = grib_action_create_concept(grib_parser_context,(grib_yyvsp[-7].str),(grib_yyvsp[-2].concept_value),0,(grib_yyvsp[-9].str),(grib_yyvsp[-5].str),0,0,0,(grib_yyvsp[0].lval),1); free((grib_yyvsp[-9].str));free((grib_yyvsp[-7].str));free((grib_yyvsp[-5].str)); } -#line 3450 "y.tab.c" +#line 3434 "y.tab.c" break; - case 193: + case 193: /* concept_list: concept_list concept_value */ #line 724 "griby.y" { (grib_yyval.concept_value) = (grib_yyvsp[0].concept_value); (grib_yyvsp[0].concept_value)->next = (grib_yyvsp[-1].concept_value); } -#line 3456 "y.tab.c" +#line 3440 "y.tab.c" break; - case 195: + case 195: /* hash_array_list: hash_array_list hash_array_value */ #line 728 "griby.y" { (grib_yyval.hash_array_value) = (grib_yyvsp[0].hash_array_value); (grib_yyvsp[0].hash_array_value)->next = (grib_yyvsp[-1].hash_array_value); } -#line 3462 "y.tab.c" +#line 3446 "y.tab.c" break; - case 196: + case 196: /* hash_array_block: HASH_ARRAY IDENT '{' hash_array_list '}' flags */ #line 731 "griby.y" { (grib_yyval.act) = grib_action_create_hash_array(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-2].hash_array_value),0,0,0,0,0,0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-4].str)); } -#line 3468 "y.tab.c" +#line 3452 "y.tab.c" break; - case 197: + case 197: /* hash_array_block: HASH_ARRAY IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 732 "griby.y" { (grib_yyval.act) = grib_action_create_hash_array(grib_parser_context,(grib_yyvsp[-10].str),0,(grib_yyvsp[-6].str),0,(grib_yyvsp[-8].str),(grib_yyvsp[-4].str),(grib_yyvsp[-2].str),0,(grib_yyvsp[0].lval),0); free((grib_yyvsp[-10].str));free((grib_yyvsp[-6].str));free((grib_yyvsp[-8].str));free((grib_yyvsp[-4].str));free((grib_yyvsp[-2].str)); } -#line 3474 "y.tab.c" +#line 3458 "y.tab.c" break; - case 199: + case 199: /* case_list: case_list case_value */ #line 736 "griby.y" { (grib_yyval.case_value) = (grib_yyvsp[0].case_value); (grib_yyvsp[0].case_value)->next = (grib_yyvsp[-1].case_value); } -#line 3480 "y.tab.c" +#line 3464 "y.tab.c" break; - case 200: + case 200: /* case_value: CASE arguments ':' instructions */ #line 739 "griby.y" { (grib_yyval.case_value) = grib_case_new(grib_parser_context,(grib_yyvsp[-2].explist),(grib_yyvsp[0].act)); } -#line 3486 "y.tab.c" +#line 3470 "y.tab.c" break; - case 201: + case 201: /* switch_block: SWITCH '(' argument_list ')' '{' case_list DEFAULT ':' instructions '}' */ #line 743 "griby.y" { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-7].explist),(grib_yyvsp[-4].case_value),(grib_yyvsp[-1].act)); } -#line 3492 "y.tab.c" +#line 3476 "y.tab.c" break; - case 202: + case 202: /* switch_block: SWITCH '(' argument_list ')' '{' case_list DEFAULT ':' '}' */ #line 744 "griby.y" { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-6].explist),(grib_yyvsp[-3].case_value),grib_action_create_noop(grib_parser_context,"continue")); } -#line 3498 "y.tab.c" +#line 3482 "y.tab.c" break; - case 203: + case 203: /* switch_block: SWITCH '(' argument_list ')' '{' case_list '}' */ #line 745 "griby.y" { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].case_value),0); } -#line 3504 "y.tab.c" +#line 3488 "y.tab.c" break; - case 204: + case 204: /* concept_value: STRING '=' '{' concept_conditions '}' */ #line 748 "griby.y" { (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].concept_condition)); free((grib_yyvsp[-4].str));} -#line 3511 "y.tab.c" +#line 3495 "y.tab.c" break; - case 205: + case 205: /* concept_value: IDENT '=' '{' concept_conditions '}' */ #line 750 "griby.y" { (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].concept_condition)); free((grib_yyvsp[-4].str));} -#line 3518 "y.tab.c" +#line 3502 "y.tab.c" break; - case 206: + case 206: /* concept_value: INTEGER '=' '{' concept_conditions '}' */ #line 752 "griby.y" { - char buf[80]; snprintf(buf,sizeof(buf),"%ld",(long)(grib_yyvsp[-4].lval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[-1].concept_condition));} -#line 3525 "y.tab.c" + char buf[80]; snprintf(buf, sizeof(buf), "%ld",(long)(grib_yyvsp[-4].lval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[-1].concept_condition));} +#line 3509 "y.tab.c" break; - case 207: + case 207: /* concept_value: FLOAT '=' '{' concept_conditions '}' */ #line 754 "griby.y" { - char buf[80]; snprintf(buf,sizeof(buf),"%g",(double)(grib_yyvsp[-4].dval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[-1].concept_condition));} -#line 3532 "y.tab.c" + char buf[80]; snprintf(buf, sizeof(buf), "%g", (double)(grib_yyvsp[-4].dval)); (grib_yyval.concept_value) = grib_concept_value_new(grib_parser_context,buf,(grib_yyvsp[-1].concept_condition));} +#line 3516 "y.tab.c" break; - case 209: + case 209: /* concept_conditions: concept_condition concept_conditions */ #line 759 "griby.y" { (grib_yyvsp[-1].concept_condition)->next = (grib_yyvsp[0].concept_condition); (grib_yyval.concept_condition) = (grib_yyvsp[-1].concept_condition); } -#line 3538 "y.tab.c" +#line 3522 "y.tab.c" break; - case 210: + case 210: /* concept_condition: IDENT '=' expression ';' */ #line 762 "griby.y" { (grib_yyval.concept_condition) = grib_concept_condition_new(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].exp),0); free((grib_yyvsp[-3].str)); } -#line 3544 "y.tab.c" +#line 3528 "y.tab.c" break; - case 211: + case 211: /* concept_condition: IDENT '=' '[' integer_array ']' ';' */ #line 763 "griby.y" { (grib_yyval.concept_condition) = grib_concept_condition_new(grib_parser_context,(grib_yyvsp[-5].str),0,(grib_yyvsp[-2].ivalue)); free((grib_yyvsp[-5].str)); } -#line 3550 "y.tab.c" +#line 3534 "y.tab.c" break; - case 212: + case 212: /* hash_array_value: STRING '=' '[' integer_array ']' */ #line 767 "griby.y" { (grib_yyval.hash_array_value) = grib_integer_hash_array_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].ivalue)); free((grib_yyvsp[-4].str));} -#line 3557 "y.tab.c" +#line 3541 "y.tab.c" break; - case 213: + case 213: /* hash_array_value: IDENT '=' '[' integer_array ']' */ #line 769 "griby.y" { (grib_yyval.hash_array_value) = grib_integer_hash_array_value_new(grib_parser_context,(grib_yyvsp[-4].str),(grib_yyvsp[-1].ivalue)); free((grib_yyvsp[-4].str));} -#line 3564 "y.tab.c" +#line 3548 "y.tab.c" break; - case 214: + case 214: /* string_or_ident: SUBSTR '(' IDENT ',' INTEGER ',' INTEGER ')' */ #line 773 "griby.y" { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-3].lval),(grib_yyvsp[-1].lval)); free((grib_yyvsp[-5].str)); } -#line 3570 "y.tab.c" +#line 3554 "y.tab.c" break; - case 215: + case 215: /* string_or_ident: IDENT */ #line 774 "griby.y" { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[0].str),0,0); free((grib_yyvsp[0].str)); } -#line 3576 "y.tab.c" +#line 3560 "y.tab.c" break; - case 216: + case 216: /* string_or_ident: SUBSTR '(' STRING ',' INTEGER ',' INTEGER ')' */ #line 775 "griby.y" { (grib_yyval.exp) = new_sub_string_expression(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-3].lval),(grib_yyvsp[-1].lval)); free((grib_yyvsp[-5].str)); } -#line 3582 "y.tab.c" +#line 3566 "y.tab.c" break; - case 217: + case 217: /* string_or_ident: STRING */ #line 776 "griby.y" { (grib_yyval.exp) = new_string_expression(grib_parser_context,(grib_yyvsp[0].str)); free((grib_yyvsp[0].str)); } -#line 3588 "y.tab.c" +#line 3572 "y.tab.c" break; - case 219: + case 219: /* atom: INTEGER */ #line 780 "griby.y" { (grib_yyval.exp) = new_long_expression(grib_parser_context,(grib_yyvsp[0].lval)); } -#line 3594 "y.tab.c" +#line 3578 "y.tab.c" break; - case 220: + case 220: /* atom: FLOAT */ #line 781 "griby.y" { (grib_yyval.exp) = new_double_expression(grib_parser_context,(grib_yyvsp[0].dval)); /* TODO: change to new_float_expression*/} -#line 3600 "y.tab.c" +#line 3584 "y.tab.c" break; - case 221: + case 221: /* atom: NIL */ #line 783 "griby.y" { (grib_yyval.exp) = NULL; } -#line 3606 "y.tab.c" +#line 3590 "y.tab.c" break; - case 222: + case 222: /* atom: DUMMY */ #line 784 "griby.y" { (grib_yyval.exp) = new_true_expression(grib_parser_context); } -#line 3612 "y.tab.c" +#line 3596 "y.tab.c" break; - case 223: + case 223: /* atom: '(' expression ')' */ #line 785 "griby.y" { (grib_yyval.exp) = (grib_yyvsp[-1].exp); } -#line 3618 "y.tab.c" +#line 3602 "y.tab.c" break; - case 224: + case 224: /* atom: '-' atom */ #line 786 "griby.y" { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_neg,&grib_op_neg_d,(grib_yyvsp[0].exp)); } -#line 3624 "y.tab.c" +#line 3608 "y.tab.c" break; - case 225: + case 225: /* atom: IDENT '(' ')' */ #line 787 "griby.y" { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-2].str),NULL); free((grib_yyvsp[-2].str));} -#line 3630 "y.tab.c" +#line 3614 "y.tab.c" break; - case 226: + case 226: /* atom: IDENT '(' argument_list ')' */ #line 788 "griby.y" { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist)); free((grib_yyvsp[-3].str));} -#line 3636 "y.tab.c" +#line 3620 "y.tab.c" break; - case 227: + case 227: /* power: atom '^' power */ #line 792 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_pow,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3642 "y.tab.c" +#line 3626 "y.tab.c" break; - case 229: + case 229: /* factor: factor '*' power */ #line 796 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_mul,&grib_op_mul_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3648 "y.tab.c" +#line 3632 "y.tab.c" break; - case 230: + case 230: /* factor: factor '/' power */ #line 797 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_div,&grib_op_div_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3654 "y.tab.c" +#line 3638 "y.tab.c" break; - case 231: + case 231: /* factor: factor '%' power */ #line 798 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_modulo,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3660 "y.tab.c" +#line 3644 "y.tab.c" break; - case 232: + case 232: /* factor: factor BIT power */ #line 799 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bit,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3666 "y.tab.c" +#line 3650 "y.tab.c" break; - case 233: + case 233: /* factor: factor BITOFF power */ #line 800 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bitoff,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3672 "y.tab.c" +#line 3656 "y.tab.c" break; - case 235: + case 235: /* factor: LENGTH '(' IDENT ')' */ #line 802 "griby.y" { (grib_yyval.exp) = new_length_expression(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} -#line 3678 "y.tab.c" +#line 3662 "y.tab.c" break; - case 236: + case 236: /* factor: IS_IN_LIST '(' IDENT ',' STRING ')' */ #line 803 "griby.y" { (grib_yyval.exp) = new_is_in_list_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str)); free((grib_yyvsp[-3].str));free((grib_yyvsp[-1].str));} -#line 3684 "y.tab.c" +#line 3668 "y.tab.c" break; - case 237: + case 237: /* factor: IS_IN_DICT '(' IDENT ',' STRING ')' */ #line 804 "griby.y" { (grib_yyval.exp) = new_is_in_dict_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].str)); free((grib_yyvsp[-3].str));free((grib_yyvsp[-1].str));} -#line 3690 "y.tab.c" +#line 3674 "y.tab.c" break; - case 238: + case 238: /* factor: IS_INTEGER '(' IDENT ',' INTEGER ')' */ #line 805 "griby.y" { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].lval),0); free((grib_yyvsp[-3].str));} -#line 3696 "y.tab.c" +#line 3680 "y.tab.c" break; - case 239: + case 239: /* factor: IS_INTEGER '(' IDENT ',' INTEGER ',' INTEGER ')' */ #line 806 "griby.y" { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-5].str),(grib_yyvsp[-3].lval),(grib_yyvsp[-1].lval)); free((grib_yyvsp[-5].str));} -#line 3702 "y.tab.c" +#line 3686 "y.tab.c" break; - case 240: + case 240: /* factor: IS_INTEGER '(' IDENT ')' */ #line 807 "griby.y" { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-1].str),0,0); free((grib_yyvsp[-1].str));} -#line 3708 "y.tab.c" +#line 3692 "y.tab.c" break; - case 241: + case 241: /* term: term '+' factor */ #line 810 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_add,&grib_op_add_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3714 "y.tab.c" +#line 3698 "y.tab.c" break; - case 242: + case 242: /* term: term '-' factor */ #line 811 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_sub,&grib_op_sub_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3720 "y.tab.c" +#line 3704 "y.tab.c" break; - case 244: + case 244: /* condition: condition GT term */ #line 815 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_gt,&grib_op_gt_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3726 "y.tab.c" +#line 3710 "y.tab.c" break; - case 245: + case 245: /* condition: condition EQ term */ #line 817 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_eq,&grib_op_eq_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3732 "y.tab.c" +#line 3716 "y.tab.c" break; - case 246: + case 246: /* condition: condition LT term */ #line 818 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_lt,&grib_op_lt_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3738 "y.tab.c" +#line 3722 "y.tab.c" break; - case 247: + case 247: /* condition: condition GE term */ #line 819 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_ge,&grib_op_ge_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3744 "y.tab.c" +#line 3728 "y.tab.c" break; - case 248: + case 248: /* condition: condition LE term */ #line 820 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_le,&grib_op_le_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3750 "y.tab.c" +#line 3734 "y.tab.c" break; - case 249: + case 249: /* condition: condition NE term */ #line 821 "griby.y" { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_ne,&grib_op_ne_d,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3756 "y.tab.c" +#line 3740 "y.tab.c" break; - case 250: + case 250: /* condition: string_or_ident IS string_or_ident */ #line 822 "griby.y" { (grib_yyval.exp) = new_string_compare_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3762 "y.tab.c" +#line 3746 "y.tab.c" break; - case 251: + case 251: /* condition: NOT condition */ #line 827 "griby.y" { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_not,NULL,(grib_yyvsp[0].exp)); } -#line 3768 "y.tab.c" +#line 3752 "y.tab.c" break; - case 253: + case 253: /* conjunction: conjunction AND condition */ #line 831 "griby.y" { (grib_yyval.exp) = new_logical_and_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3774 "y.tab.c" +#line 3758 "y.tab.c" break; - case 255: + case 255: /* disjunction: disjunction OR conjunction */ #line 835 "griby.y" { (grib_yyval.exp) = new_logical_or_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp));} -#line 3780 "y.tab.c" +#line 3764 "y.tab.c" break; - case 260: + case 260: /* rule_entry: IDENT '=' expression ';' */ #line 849 "griby.y" { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].exp)); free((grib_yyvsp[-3].str)); } -#line 3786 "y.tab.c" +#line 3770 "y.tab.c" break; - case 261: + case 261: /* rule_entry: SKIP ';' */ #line 850 "griby.y" { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,"skip",0);} -#line 3792 "y.tab.c" +#line 3776 "y.tab.c" break; - case 263: + case 263: /* rule_entries: rule_entry rule_entries */ #line 854 "griby.y" { (grib_yyvsp[-1].rule_entry)->next = (grib_yyvsp[0].rule_entry); (grib_yyval.rule_entry) = (grib_yyvsp[-1].rule_entry); } -#line 3798 "y.tab.c" +#line 3782 "y.tab.c" break; - case 264: + case 264: /* fact: rule_entry */ #line 857 "griby.y" { (grib_yyval.rules) = grib_new_rule(grib_parser_context,NULL,(grib_yyvsp[0].rule_entry)); } -#line 3804 "y.tab.c" +#line 3788 "y.tab.c" break; - case 265: + case 265: /* conditional_rule: IF '(' expression ')' '{' rule_entries '}' */ #line 861 "griby.y" { (grib_yyval.rules) = grib_new_rule(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].rule_entry)); } -#line 3810 "y.tab.c" +#line 3794 "y.tab.c" break; - case 267: + case 267: /* rules: rule rules */ #line 865 "griby.y" { (grib_yyvsp[-1].rules)->next = (grib_yyvsp[0].rules); (grib_yyval.rules) = (grib_yyvsp[-1].rules); } -#line 3816 "y.tab.c" +#line 3800 "y.tab.c" break; -#line 3820 "y.tab.c" +#line 3804 "y.tab.c" default: break; } @@ -3831,11 +3815,10 @@ grib_yyparse (void) case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", grib_yyr1[grib_yyn], &grib_yyval, &grib_yyloc); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (grib_yysymbol_kind_t, grib_yyr1[grib_yyn]), &grib_yyval, &grib_yyloc); YYPOPSTACK (grib_yylen); grib_yylen = 0; - YY_STACK_PRINT (grib_yyss, grib_yyssp); *++grib_yyvsp = grib_yyval; @@ -3859,50 +3842,14 @@ grib_yyparse (void) grib_yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - grib_yytoken = grib_yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (grib_yychar); - + grib_yytoken = grib_yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (grib_yychar); /* If not already recovering from an error, report this error. */ if (!grib_yyerrstatus) { ++grib_yynerrs; -#if ! YYERROR_VERBOSE grib_yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR grib_yysyntax_error (&grib_yymsg_alloc, &grib_yymsg, \ - grib_yyssp, grib_yytoken) - { - char const *grib_yymsgp = YY_("syntax error"); - int grib_yysyntax_error_status; - grib_yysyntax_error_status = YYSYNTAX_ERROR; - if (grib_yysyntax_error_status == 0) - grib_yymsgp = grib_yymsg; - else if (grib_yysyntax_error_status == 1) - { - if (grib_yymsg != grib_yymsgbuf) - YYSTACK_FREE (grib_yymsg); - grib_yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, grib_yymsg_alloc))); - if (!grib_yymsg) - { - grib_yymsg = grib_yymsgbuf; - grib_yymsg_alloc = sizeof grib_yymsgbuf; - grib_yysyntax_error_status = 2; - } - else - { - grib_yysyntax_error_status = YYSYNTAX_ERROR; - grib_yymsgp = grib_yymsg; - } - } - grib_yyerror (grib_yymsgp); - if (grib_yysyntax_error_status == 2) - goto grib_yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif } - - if (grib_yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -3935,6 +3882,7 @@ grib_yyparse (void) label grib_yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++grib_yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -3951,13 +3899,14 @@ grib_yyparse (void) grib_yyerrlab1: grib_yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { grib_yyn = grib_yypact[grib_yystate]; if (!grib_yypact_value_is_default (grib_yyn)) { - grib_yyn += YYTERROR; - if (0 <= grib_yyn && grib_yyn <= YYLAST && grib_yycheck[grib_yyn] == YYTERROR) + grib_yyn += YYSYMBOL_YYerror; + if (0 <= grib_yyn && grib_yyn <= YYLAST && grib_yycheck[grib_yyn] == YYSYMBOL_YYerror) { grib_yyn = grib_yytable[grib_yyn]; if (0 < grib_yyn) @@ -3971,7 +3920,7 @@ grib_yyparse (void) grib_yydestruct ("Error: popping", - grib_yystos[grib_yystate], grib_yyvsp); + YY_ACCESSING_SYMBOL (grib_yystate), grib_yyvsp); YYPOPSTACK (1); grib_yystate = *grib_yyssp; YY_STACK_PRINT (grib_yyss, grib_yyssp); @@ -3983,7 +3932,7 @@ grib_yyparse (void) /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", grib_yystos[grib_yyn], grib_yyvsp, grib_yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (grib_yyn), grib_yyvsp, grib_yylsp); grib_yystate = grib_yyn; goto grib_yynewstate; @@ -3994,7 +3943,7 @@ grib_yyparse (void) `-------------------------------------*/ grib_yyacceptlab: grib_yyresult = 0; - goto grib_yyreturn; + goto grib_yyreturnlab; /*-----------------------------------. @@ -4002,24 +3951,22 @@ grib_yyparse (void) `-----------------------------------*/ grib_yyabortlab: grib_yyresult = 1; - goto grib_yyreturn; + goto grib_yyreturnlab; -#if !defined grib_yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| grib_yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| grib_yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ grib_yyexhaustedlab: grib_yyerror (YY_("memory exhausted")); grib_yyresult = 2; - /* Fall through. */ -#endif + goto grib_yyreturnlab; -/*-----------------------------------------------------. -| grib_yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -grib_yyreturn: +/*----------------------------------------------------------. +| grib_yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +grib_yyreturnlab: if (grib_yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -4035,19 +3982,17 @@ grib_yyparse (void) while (grib_yyssp != grib_yyss) { grib_yydestruct ("Cleanup: popping", - grib_yystos[+*grib_yyssp], grib_yyvsp); + YY_ACCESSING_SYMBOL (+*grib_yyssp), grib_yyvsp); YYPOPSTACK (1); } #ifndef grib_yyoverflow if (grib_yyss != grib_yyssa) YYSTACK_FREE (grib_yyss); #endif -#if YYERROR_VERBOSE - if (grib_yymsg != grib_yymsgbuf) - YYSTACK_FREE (grib_yymsg); -#endif + return grib_yyresult; } + #line 869 "griby.y" diff --git a/src/grib_yacc.h b/src/grib_yacc.h index 5fe8ca334..e99fb7050 100644 --- a/src/grib_yacc.h +++ b/src/grib_yacc.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.5.4. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or grib_yy_. They are + private implementation details that can be changed or removed. */ #ifndef YY_YY_Y_TAB_H_INCLUDED # define YY_YY_Y_TAB_H_INCLUDED @@ -44,138 +45,147 @@ extern int grib_yydebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum grib_yytokentype { - LOWERCASE = 258, - IF = 259, - IF_TRANSIENT = 260, - ELSE = 261, - END = 262, - CLOSE = 263, - UNSIGNED = 264, - TEMPLATE = 265, - TEMPLATE_NOFAIL = 266, - TRIGGER = 267, - ASCII = 268, - GROUP = 269, - NON_ALPHA = 270, - KSEC1EXPVER = 271, - LABEL = 272, - LIST = 273, - IS_IN_LIST = 274, - IS_IN_DICT = 275, - IS_INTEGER = 276, - TO_INTEGER = 277, - TO_STRING = 278, - SEX2DEC = 279, - WHILE = 280, - IBMFLOAT = 281, - SIGNED = 282, - UINT8 = 283, - INT8 = 284, - UINT16 = 285, - INT16 = 286, - UINT16_LITTLE_ENDIAN = 287, - INT16_LITTLE_ENDIAN = 288, - UINT32 = 289, - INT32 = 290, - UINT32_LITTLE_ENDIAN = 291, - INT32_LITTLE_ENDIAN = 292, - UINT64 = 293, - INT64 = 294, - UINT64_LITTLE_ENDIAN = 295, - INT64_LITTLE_ENDIAN = 296, - BLOB = 297, - BYTE = 298, - CODETABLE = 299, - SMART_TABLE = 300, - DICTIONARY = 301, - COMPLEX_CODETABLE = 302, - LOOKUP = 303, - ALIAS = 304, - UNALIAS = 305, - META = 306, - POS = 307, - INTCONST = 308, - TRANS = 309, - FLAGBIT = 310, - CONCEPT = 311, - GETENV = 312, - HASH_ARRAY = 313, - CONCEPT_NOFAIL = 314, - NIL = 315, - DUMMY = 316, - MODIFY = 317, - READ_ONLY = 318, - STRING_TYPE = 319, - LONG_TYPE = 320, - DOUBLE_TYPE = 321, - NO_COPY = 322, - DUMP = 323, - JSON = 324, - XML = 325, - NO_FAIL = 326, - EDITION_SPECIFIC = 327, - OVERRIDE = 328, - HIDDEN = 329, - CAN_BE_MISSING = 330, - MISSING = 331, - CONSTRAINT = 332, - COPY_OK = 333, - WHEN = 334, - SET = 335, - SET_NOFAIL = 336, - WRITE = 337, - APPEND = 338, - PRINT = 339, - EXPORT = 340, - REMOVE = 341, - RENAME = 342, - SKIP = 343, - PAD = 344, - SECTION_PADDING = 345, - MESSAGE = 346, - MESSAGE_COPY = 347, - PADTO = 348, - PADTOEVEN = 349, - PADTOMULTIPLE = 350, - G1_HALF_BYTE = 351, - G1_MESSAGE_LENGTH = 352, - G1_SECTION4_LENGTH = 353, - SECTION_LENGTH = 354, - LENGTH = 355, - FLAG = 356, - ITERATOR = 357, - NEAREST = 358, - BOX = 359, - KSEC = 360, - ASSERT = 361, - SUBSTR = 362, - CASE = 363, - SWITCH = 364, - DEFAULT = 365, - EQ = 366, - NE = 367, - GE = 368, - LE = 369, - LT = 370, - GT = 371, - BIT = 372, - BITOFF = 373, - AND = 374, - OR = 375, - NOT = 376, - IS = 377, - IDENT = 378, - STRING = 379, - INTEGER = 380, - FLOAT = 381 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + LOWERCASE = 258, /* LOWERCASE */ + IF = 259, /* IF */ + IF_TRANSIENT = 260, /* IF_TRANSIENT */ + ELSE = 261, /* ELSE */ + END = 262, /* END */ + CLOSE = 263, /* CLOSE */ + UNSIGNED = 264, /* UNSIGNED */ + TEMPLATE = 265, /* TEMPLATE */ + TEMPLATE_NOFAIL = 266, /* TEMPLATE_NOFAIL */ + TRIGGER = 267, /* TRIGGER */ + ASCII = 268, /* ASCII */ + GROUP = 269, /* GROUP */ + NON_ALPHA = 270, /* NON_ALPHA */ + KSEC1EXPVER = 271, /* KSEC1EXPVER */ + LABEL = 272, /* LABEL */ + LIST = 273, /* LIST */ + IS_IN_LIST = 274, /* IS_IN_LIST */ + IS_IN_DICT = 275, /* IS_IN_DICT */ + IS_INTEGER = 276, /* IS_INTEGER */ + TO_INTEGER = 277, /* TO_INTEGER */ + TO_STRING = 278, /* TO_STRING */ + SEX2DEC = 279, /* SEX2DEC */ + WHILE = 280, /* WHILE */ + IBMFLOAT = 281, /* IBMFLOAT */ + SIGNED = 282, /* SIGNED */ + UINT8 = 283, /* UINT8 */ + INT8 = 284, /* INT8 */ + UINT16 = 285, /* UINT16 */ + INT16 = 286, /* INT16 */ + UINT16_LITTLE_ENDIAN = 287, /* UINT16_LITTLE_ENDIAN */ + INT16_LITTLE_ENDIAN = 288, /* INT16_LITTLE_ENDIAN */ + UINT32 = 289, /* UINT32 */ + INT32 = 290, /* INT32 */ + UINT32_LITTLE_ENDIAN = 291, /* UINT32_LITTLE_ENDIAN */ + INT32_LITTLE_ENDIAN = 292, /* INT32_LITTLE_ENDIAN */ + UINT64 = 293, /* UINT64 */ + INT64 = 294, /* INT64 */ + UINT64_LITTLE_ENDIAN = 295, /* UINT64_LITTLE_ENDIAN */ + INT64_LITTLE_ENDIAN = 296, /* INT64_LITTLE_ENDIAN */ + BLOB = 297, /* BLOB */ + BYTE = 298, /* BYTE */ + CODETABLE = 299, /* CODETABLE */ + SMART_TABLE = 300, /* SMART_TABLE */ + DICTIONARY = 301, /* DICTIONARY */ + COMPLEX_CODETABLE = 302, /* COMPLEX_CODETABLE */ + LOOKUP = 303, /* LOOKUP */ + ALIAS = 304, /* ALIAS */ + UNALIAS = 305, /* UNALIAS */ + META = 306, /* META */ + POS = 307, /* POS */ + INTCONST = 308, /* INTCONST */ + TRANS = 309, /* TRANS */ + FLAGBIT = 310, /* FLAGBIT */ + CONCEPT = 311, /* CONCEPT */ + GETENV = 312, /* GETENV */ + HASH_ARRAY = 313, /* HASH_ARRAY */ + CONCEPT_NOFAIL = 314, /* CONCEPT_NOFAIL */ + NIL = 315, /* NIL */ + DUMMY = 316, /* DUMMY */ + MODIFY = 317, /* MODIFY */ + READ_ONLY = 318, /* READ_ONLY */ + STRING_TYPE = 319, /* STRING_TYPE */ + LONG_TYPE = 320, /* LONG_TYPE */ + DOUBLE_TYPE = 321, /* DOUBLE_TYPE */ + NO_COPY = 322, /* NO_COPY */ + DUMP = 323, /* DUMP */ + JSON = 324, /* JSON */ + XML = 325, /* XML */ + NO_FAIL = 326, /* NO_FAIL */ + EDITION_SPECIFIC = 327, /* EDITION_SPECIFIC */ + OVERRIDE = 328, /* OVERRIDE */ + HIDDEN = 329, /* HIDDEN */ + CAN_BE_MISSING = 330, /* CAN_BE_MISSING */ + MISSING = 331, /* MISSING */ + CONSTRAINT = 332, /* CONSTRAINT */ + COPY_OK = 333, /* COPY_OK */ + WHEN = 334, /* WHEN */ + SET = 335, /* SET */ + SET_NOFAIL = 336, /* SET_NOFAIL */ + WRITE = 337, /* WRITE */ + APPEND = 338, /* APPEND */ + PRINT = 339, /* PRINT */ + EXPORT = 340, /* EXPORT */ + REMOVE = 341, /* REMOVE */ + RENAME = 342, /* RENAME */ + SKIP = 343, /* SKIP */ + PAD = 344, /* PAD */ + SECTION_PADDING = 345, /* SECTION_PADDING */ + MESSAGE = 346, /* MESSAGE */ + MESSAGE_COPY = 347, /* MESSAGE_COPY */ + PADTO = 348, /* PADTO */ + PADTOEVEN = 349, /* PADTOEVEN */ + PADTOMULTIPLE = 350, /* PADTOMULTIPLE */ + G1_HALF_BYTE = 351, /* G1_HALF_BYTE */ + G1_MESSAGE_LENGTH = 352, /* G1_MESSAGE_LENGTH */ + G1_SECTION4_LENGTH = 353, /* G1_SECTION4_LENGTH */ + SECTION_LENGTH = 354, /* SECTION_LENGTH */ + LENGTH = 355, /* LENGTH */ + FLAG = 356, /* FLAG */ + ITERATOR = 357, /* ITERATOR */ + NEAREST = 358, /* NEAREST */ + BOX = 359, /* BOX */ + KSEC = 360, /* KSEC */ + ASSERT = 361, /* ASSERT */ + SUBSTR = 362, /* SUBSTR */ + CASE = 363, /* CASE */ + SWITCH = 364, /* SWITCH */ + DEFAULT = 365, /* DEFAULT */ + EQ = 366, /* EQ */ + NE = 367, /* NE */ + GE = 368, /* GE */ + LE = 369, /* LE */ + LT = 370, /* LT */ + GT = 371, /* GT */ + BIT = 372, /* BIT */ + BITOFF = 373, /* BITOFF */ + AND = 374, /* AND */ + OR = 375, /* OR */ + NOT = 376, /* NOT */ + IS = 377, /* IS */ + IDENT = 378, /* IDENT */ + STRING = 379, /* STRING */ + INTEGER = 380, /* INTEGER */ + FLOAT = 381 /* FLOAT */ }; + typedef enum grib_yytokentype grib_yytoken_kind_t; #endif -/* Tokens. */ +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 #define LOWERCASE 258 #define IF 259 #define IF_TRANSIENT 260 @@ -319,11 +329,11 @@ union YYSTYPE grib_concept_condition *concept_condition; grib_concept_value *concept_value; grib_hash_array_value *hash_array_value; - grib_case *case_value; + grib_case *case_value; grib_rule *rules; grib_rule_entry *rule_entry; -#line 327 "y.tab.h" +#line 337 "y.tab.h" }; typedef union YYSTYPE YYSTYPE; @@ -334,6 +344,8 @@ typedef union YYSTYPE YYSTYPE; extern YYSTYPE grib_yylval; + int grib_yyparse (void); + #endif /* !YY_YY_Y_TAB_H_INCLUDED */ From 2df3f5518a92970fc9a6f62c28941ca039cfd887 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 13:10:09 +0000 Subject: [PATCH 033/212] ECC-1508: Tune compilation flags --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3dea9e97..42ae03468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)") if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) ecbuild_add_cxx_flags("-Wno-write-strings -Wno-deprecated") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - ecbuild_add_cxx_flags("-Wno-deprecated") + ecbuild_add_cxx_flags("-Wno-write-strings -Wno-deprecated") elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" ) set(CMAKE_CXX_FLAGS "-hstd=c++11 ${CMAKE_CXX_FLAGS}") endif() From 1e99dbd71ad0297818ab76ead2d3ee332e96f165 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 14:17:12 +0000 Subject: [PATCH 034/212] ECC-1508: Update hierarchy docs --- src/accessor_class_hierarchy.txt | 8 +++++++- src/action_class_hierarchy.txt | 2 +- src/iterator_class_hierarchy.txt | 2 +- src/make_accessor_class_hierarchy_dirs.sh | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/accessor_class_hierarchy.txt b/src/accessor_class_hierarchy.txt index 180f6edbf..2fdf983e3 100644 --- a/src/accessor_class_hierarchy.txt +++ b/src/accessor_class_hierarchy.txt @@ -1,6 +1,7 @@ Accessor Class Hierarchy. Generated by src/make_accessor_class_hierarchy_dirs.sh + |-grib_accessor_class_forward |-grib_accessor_class_gen |---grib_accessor_class_abstract_long_vector |-----grib_accessor_class_g1step_range @@ -17,11 +18,11 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-----grib_accessor_class_mars_param |-----grib_accessor_class_mars_step |-----grib_accessor_class_sprintf + |-----grib_accessor_class_trim |---grib_accessor_class_assert |---grib_accessor_class_bits |---grib_accessor_class_blob |---grib_accessor_class_box - |---grib_accessor_class_bufr_data |---grib_accessor_class_bufr_data_array |---grib_accessor_class_bufr_data_element |---grib_accessor_class_bufr_elements_table @@ -40,6 +41,7 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-------grib_accessor_class_padtoeven |-------grib_accessor_class_padtomultiple |-------grib_accessor_class_section_padding + |---grib_accessor_class_change_alternative_row_scanning |---grib_accessor_class_change_scanning_direction |---grib_accessor_class_codetable_title |---grib_accessor_class_codetable_units @@ -61,6 +63,7 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-------grib_accessor_class_statistics |-------grib_accessor_class_statistics_spectral |-------grib_accessor_class_vector + |-----grib_accessor_class_closest_date |-----grib_accessor_class_divdouble |-----grib_accessor_class_from_scale_factor_scaled_value |-----grib_accessor_class_g1area @@ -170,10 +173,12 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |---grib_accessor_class_number_of_values_data_raw_packing |---grib_accessor_class_pack_bufr_values |---grib_accessor_class_position + |---grib_accessor_class_proj_string |---grib_accessor_class_raw |---grib_accessor_class_section |---grib_accessor_class_section_pointer |---grib_accessor_class_smart_table_column + |---grib_accessor_class_step_human_readable |---grib_accessor_class_to_double |-----grib_accessor_class_sexagesimal2decimal |---grib_accessor_class_to_integer @@ -193,6 +198,7 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |-----grib_accessor_class_data_g22order_packing |-----grib_accessor_class_data_png_packing |-----grib_accessor_class_data_raw_packing + |-----grib_accessor_class_data_run_length_packing |-----grib_accessor_class_data_simple_packing |-------grib_accessor_class_data_complex_packing |---------grib_accessor_class_data_g1complex_packing diff --git a/src/action_class_hierarchy.txt b/src/action_class_hierarchy.txt index 132ec468d..6c311c70c 100644 --- a/src/action_class_hierarchy.txt +++ b/src/action_class_hierarchy.txt @@ -1,5 +1,5 @@ - Action Class Hierarchy + |action |-action_class_alias |-action_class_assert diff --git a/src/iterator_class_hierarchy.txt b/src/iterator_class_hierarchy.txt index 730373f0d..e692fa5c7 100644 --- a/src/iterator_class_hierarchy.txt +++ b/src/iterator_class_hierarchy.txt @@ -1,5 +1,5 @@ - Iterator Class Hierarchy + |-grib_iterator_class_gen |---grib_iterator_class_gaussian_reduced |---grib_iterator_class_lambert_azimuthal_equal_area diff --git a/src/make_accessor_class_hierarchy_dirs.sh b/src/make_accessor_class_hierarchy_dirs.sh index d5152266b..880f5ea2f 100755 --- a/src/make_accessor_class_hierarchy_dirs.sh +++ b/src/make_accessor_class_hierarchy_dirs.sh @@ -10,8 +10,8 @@ ROOT=$TMPDIR/ecCodes_Accessor_Class_Hierarchy rm -fr $ROOT; mkdir $ROOT # Assume we're in the src directory -for f in grib_accessor_class_*.c; do - fbase=`echo $f | sed -e 's/\.c$//'` +for f in grib_accessor_class_*.cpp; do + fbase=`echo $f | sed -e 's/\.cpp$//'` super=`grep 'SUPER *= *' $f | awk '{print $3}'` if [ "$super" != "" ] ; then super_path=`find $ROOT -type d -name $super` From fe05e2e347d824bcefd3a3279adffea3b9d062db Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 14:21:58 +0000 Subject: [PATCH 035/212] ECC-1508: Update docs --- tools/big2gribex.cpp | 2 +- tools/gts_dump.cpp | 2 +- tools/metar_dump.cpp | 2 +- tools/metar_ls.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/big2gribex.cpp b/tools/big2gribex.cpp index 059ad6988..a36b01126 100644 --- a/tools/big2gribex.cpp +++ b/tools/big2gribex.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: big2gribex + * Implementation: big2gribex * * Description: * diff --git a/tools/gts_dump.cpp b/tools/gts_dump.cpp index b33831ef0..0f297393b 100644 --- a/tools/gts_dump.cpp +++ b/tools/gts_dump.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: gts_dump + * Implementation: gts_dump * * */ diff --git a/tools/metar_dump.cpp b/tools/metar_dump.cpp index 080ec8ea3..4e0e2b8d4 100644 --- a/tools/metar_dump.cpp +++ b/tools/metar_dump.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: grib_dump + * Implementation: grib_dump * * Author: Enrico Fucile * diff --git a/tools/metar_ls.cpp b/tools/metar_ls.cpp index ebb160c80..794438715 100644 --- a/tools/metar_ls.cpp +++ b/tools/metar_ls.cpp @@ -9,7 +9,7 @@ */ /* - * C Implementation: grib_ls + * Implementation: grib_ls * * Author: Enrico Fucile * From 2cf3dfc5608fbc43194f6959b8b6cf91bc5d50f5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 14:24:19 +0000 Subject: [PATCH 036/212] ECC-1508: Update docs --- INSTALL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index e74cf260d..802e3cc22 100644 --- a/INSTALL +++ b/INSTALL @@ -45,8 +45,8 @@ You can also pass options to the cmake command above. Some typical examples are: -DENABLE_ECCODES_THREADS=ON Enable POSIX threads -DENABLE_JPG=ON Enable JPEG encoding/decoding (for GRIB packing) -DCMAKE_Fortran_COMPILER=pgf90 Set Fortran compiler to Portland Group F90 compiler - -DCMAKE_C_FLAGS="-O2 -Wall" Prepend the specified flags at the front - of the compilation command for C source files + -DCMAKE_CXX_FLAGS="-O2 -Wall" Prepend the specified flags at the front + of the compilation command for C++ source files By default the ctest step above does NOT require any data to be downloaded and only runs basic sanity tests. However if you wish to exercise more of the functionality of ecCodes, you are advised to configure the build with: From be8803d913b4c0d7616e9a7a91413e24cb964f09 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 18:10:47 +0000 Subject: [PATCH 037/212] Remove deprecated files --- definitions/dummy.am | 0 experimental/templates/dummy.am | 0 python/dummy.am | 0 src/dummy.am | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 definitions/dummy.am delete mode 100644 experimental/templates/dummy.am delete mode 100644 python/dummy.am delete mode 100644 src/dummy.am diff --git a/definitions/dummy.am b/definitions/dummy.am deleted file mode 100644 index e69de29bb..000000000 diff --git a/experimental/templates/dummy.am b/experimental/templates/dummy.am deleted file mode 100644 index e69de29bb..000000000 diff --git a/python/dummy.am b/python/dummy.am deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/dummy.am b/src/dummy.am deleted file mode 100644 index e69de29bb..000000000 From 9277d89d98803c301950a39b7320a254b78cbdbc Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 18:52:34 +0000 Subject: [PATCH 038/212] GitHub actions: pass ecCodes-specific cmake options --- .github/.cmake-options | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/.cmake-options diff --git a/.github/.cmake-options b/.github/.cmake-options new file mode 100644 index 000000000..213b78382 --- /dev/null +++ b/.github/.cmake-options @@ -0,0 +1 @@ +-DENABLE_EXTRA_TESTS=1 From 46ff2952d5b6e8cf68e0fb2548698f86d50a661f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 22:29:03 +0000 Subject: [PATCH 039/212] ECC-1508: Helper scripts --- src/make_hash_keys.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/make_hash_keys.sh b/src/make_hash_keys.sh index 83efd6d9f..99a9ab9f7 100755 --- a/src/make_hash_keys.sh +++ b/src/make_hash_keys.sh @@ -8,7 +8,7 @@ echo "List all keys..." cd ../src -# Editing keys grib_hash_keys.c +# Editing keys grib_hash_keys.cpp # -l Compare key lengths before trying a string comparison # -C Make the contents of generated lookup tables constant, i.e., readonly # -I Include the necessary system include file at the beginning of the code @@ -18,8 +18,8 @@ cd ../src # -N Specify name of generated lookup function gperf -l -C -I -t -G -H hash_keys -N grib_keys_hash_get -m 3 ../tests/keys |\ - sed -e '/^#line /d' > grib_hash_keys.c + sed -e '/^#line /d' > grib_hash_keys.cpp -cat grib_itrie_keys.c >> grib_hash_keys.c +cat grib_itrie_keys.cpp >> grib_hash_keys.cpp echo ALL DONE From 973c82c8be38e28f62a84369049177fec6370574 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 29 Jan 2023 22:32:25 +0000 Subject: [PATCH 040/212] ECC-1508: Helper scripts --- src/make_accessor_class_hash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/make_accessor_class_hash.sh b/src/make_accessor_class_hash.sh index 6e8236c9e..ee98cbc0c 100755 --- a/src/make_accessor_class_hash.sh +++ b/src/make_accessor_class_hash.sh @@ -12,11 +12,11 @@ EOF cat grib_accessor_factory_hash_list | sed 's/\/\*/#/g' >> accessor_class_list.gperf -# editing grib_accessor_classes_hash.c +# editing grib_accessor_classes_hash.cpp gperf --version echo gperf -C -W classes -t -G -H grib_accessor_classes_get_id -N grib_accessor_classes_hash -m 1 -j 1 accessor_class_list.gperf |\ - sed s/__inline//g | sed s/inline//g > grib_accessor_classes_hash.c + sed s/__inline//g | sed s/inline//g > grib_accessor_classes_hash.cpp From 17ca872f69dc1f70b4eb912ba9a17ac0315e7fe5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Jan 2023 10:53:14 +0000 Subject: [PATCH 041/212] ECC-1508: Set C++ standard to 11 and re-enable test --- CMakeLists.txt | 3 +++ tests/CMakeLists.txt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42ae03468..96fde7dc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,9 @@ find_package( ecbuild 3.7 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CUR # Initialise project project( eccodes VERSION 2.30.0 LANGUAGES CXX ) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + ############################################################################### # system checks needed for eccodes_config.h and some options like MEMFS diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e62e2ee1b..11ad25254 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,7 +32,7 @@ list(APPEND test_c_bins grib_optimize_scaling_sh grib_set_force grib_ecc-386 - # grib_ecc-1431 + grib_ecc-1431 bufr_ecc-517 bufr_ecc-1288 bufr_get_element @@ -271,9 +271,9 @@ if( HAVE_BUILD_TOOLS ) codes_split_file grib_mars_keys) - #if( HAVE_AEC AND ENABLE_EXTRA_TESTS ) - # list(APPEND tests_extra grib_ecc-1431) - #endif() + if( HAVE_AEC AND ENABLE_EXTRA_TESTS ) + list(APPEND tests_extra grib_ecc-1431) + endif() if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS ) list(APPEND tests_extra bufr_dump_encode_fortran) list(APPEND tests_extra bufr_dump_decode_fortran) From 995ed22fea493a9ecaacb96719ef12526a1c5e6b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Jan 2023 12:26:36 +0000 Subject: [PATCH 042/212] ECC-1508: Change file extensions to '.cc' --- tests/{grib_ecc-1467.cpp => grib_ecc-1467.cc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{grib_ecc-1467.cpp => grib_ecc-1467.cc} (100%) diff --git a/tests/grib_ecc-1467.cpp b/tests/grib_ecc-1467.cc similarity index 100% rename from tests/grib_ecc-1467.cpp rename to tests/grib_ecc-1467.cc From 2cad3be88bdca45650e55bb952c395123c4ed916 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 30 Jan 2023 13:38:13 +0000 Subject: [PATCH 043/212] ECC-1467: Complex packing single-precision --- src/eccodes_prototypes.h | 1 + ...grib_accessor_class_data_complex_packing.c | 227 +++++++++++++++++- src/grib_ieeefloat.c | 40 +++ tests/grib_ecc-1467.c | 105 ++++---- tests/grib_ecc-1467.sh | 43 +++- 5 files changed, 350 insertions(+), 66 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index ac0793765..a4215546c 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -840,6 +840,7 @@ int grib_nearest_smaller_ieee_float(double a, double* ret); unsigned long grib_ieee64_to_long(double x); double grib_long_to_ieee64(unsigned long x); int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val); +int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val); int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, unsigned char* buf); /* grib_accessor_class_reference_value_error.c */ diff --git a/src/grib_accessor_class_data_complex_packing.c b/src/grib_accessor_class_data_complex_packing.c index bf3eec285..652b7f3bf 100644 --- a/src/grib_accessor_class_data_complex_packing.c +++ b/src/grib_accessor_class_data_complex_packing.c @@ -442,6 +442,12 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) mmax++; } + + for (int i = n_vals-10; i < n_vals; ++i) { + printf("d: %f\n", val[i]); + } + + Assert(*len >= i); *len = i; @@ -449,10 +455,229 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } + + + // TODO(maee): ECC-1467 static int unpack_float(grib_accessor* a, float* val, size_t* len) { - return GRIB_NOT_IMPLEMENTED; + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + float* scals = NULL; + float *pscals = NULL, *pval = NULL; + + double s = 0; + double d = 0; + double laplacianOperator = 0; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; + unsigned long packed_offset; + long lpos = 0; + + long maxv = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + float operat = 0; + int bytes; + int err = 0; + + decode_float_proc decode_float = NULL; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) + return ret; + + /* ECC-774: don't use grib_get_long_internal */ + if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) + return ret; + + self->dirty = 0; + + switch (ieee_floats) { + case 0: + decode_float = grib_long_to_ibm; + bytes = 4; + break; + case 1: + decode_float = grib_long_to_ieee; + bytes = 4; + break; + case 2: + decode_float = grib_long_to_ieee64; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; + } + + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); + + buf = (unsigned char*)gh->buffer->data; + + maxv = pen_j + 1; + + buf += grib_byte_offset(a); + hres = buf; + lres = buf; + + if (pen_j == sub_j) { + n_vals = (pen_j + 1) * (pen_j + 2); + d = grib_power(-decimal_scale_factor, 10); + grib_ieee_decode_array_float(a->context, buf, n_vals, bytes, val); + if (d) { + for (i = 0; i < n_vals; i++) + val[i] *= d; + } + return 0; + } + + + packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); + + lpos = 8 * (packed_offset - offsetdata); + + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); + + scals = (float*)grib_context_malloc(a->context, maxv * sizeof(float)); + Assert(scals); + + scals[0] = 0; + for (i = 1; i < maxv; i++) { + operat = pow(i * (i + 1), laplacianOperator); + if (operat != 0) + scals[i] = (1.0 / operat); + else { + grib_context_log(a->context, GRIB_LOG_WARNING, + "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", + i, maxv); + scals[i] = 0; + } + } + + /* + printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); + printf("packed offset=%ld\n",packed_offset); + for(i=0;i 0) { + lup = mmax; + if (sub_k >= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + + if (GRIBEX_sh_bug_present && hcount == sub_k) { + /* bug in ecmwf data, last row (K+1)is scaled but should not */ + val[i - 2] *= scals[lup]; + val[i - 1] *= scals[lup]; + } + lup++; + } + sub_k--; + } + + pscals = scals + lup; + pval = val + i; +#if FAST_BIG_ENDIAN + grib_decode_double_array_complex(lres, + &lpos, bits_per_value, + reference_value, s, pscals, (maxv - hcount) * 2, pval); + i += (maxv - hcount) * 2; +#else + (void)pscals; /* suppress gcc warning */ + (void)pval; /* suppress gcc warning */ + for (lcount = hcount; lcount < maxv; lcount++) { + val[i++] = d * (float)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + val[i++] = d * (float)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + /* These values should always be zero, but as they are packed, + it is necessary to force them back to zero */ + if (mmax == 0) + val[i - 1] = 0; + lup++; + } +#endif + + maxv--; + hcount = 0; + mmax++; + } + + for (int i = n_vals-10; i < n_vals; ++i) { + printf("f: %f\n", val[i]); + } + + Assert(*len >= i); + *len = i; + + grib_context_free(a->context, scals); + + return ret; } #define MAXVAL(a, b) a > b ? a : b diff --git a/src/grib_ieeefloat.c b/src/grib_ieeefloat.c index 2c88d7630..b8bb60fd4 100644 --- a/src/grib_ieeefloat.c +++ b/src/grib_ieeefloat.c @@ -246,6 +246,7 @@ double grib_long_to_ieee(unsigned long x) return val; } + unsigned long grib_ieee_nearest_smaller_to_long(double x) { unsigned long l; @@ -386,6 +387,34 @@ int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, in return err; } +int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val) +{ + int err = 0, i = 0, j = 0; + unsigned char s[4] = {0,}; + float fval; + + switch (bytes) { + case 4: + for (i = 0; i < nvals; i++) { +#if IEEE_LE + for (j = 3; j >= 0; j--) + s[j] = *(buf++); + memcpy(&val[i], s, 4); +#elif IEEE_BE + memcpy(&val[i], buf, 4); + buf += 4; +#endif + } + break; + default: + grib_context_log(c, GRIB_LOG_ERROR, + "grib_ieee_decode_array_float: %d bits not implemented", bytes * 8); + return GRIB_NOT_IMPLEMENTED; + } + + return err; +} + #else int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val) @@ -399,6 +428,17 @@ int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, in return err; } +int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val) +{ + int err = 0, i = 0; + long bitr = 0; + + for (i = 0; i < nvals; i++) + val[i] = (float) grib_long_to_ieee(grib_decode_unsigned_long(buf, &bitr, bytes * 8)); + + return err; +} + #endif #ifdef IEEE diff --git a/tests/grib_ecc-1467.c b/tests/grib_ecc-1467.c index 809c6c346..887964c8e 100644 --- a/tests/grib_ecc-1467.c +++ b/tests/grib_ecc-1467.c @@ -9,84 +9,85 @@ */ #include #include +#include #undef NDEBUG #include #include "eccodes.h" +#include "grib_api_internal.h" int main(int argc, char** argv) { - int err = 0; - float* fvalues = NULL; /* data values as floats */ - double* dvalues = NULL; /* data values as doubles */ - size_t values_len = 0; // number of data points - size_t cvalues_len = 0; // coded values excluding missing - size_t i = 0; - int mode = 2; // 1=single-precision, 2=double-precision + int err = 0; + float* fvalues = NULL; /* data values as floats */ + double* dvalues = NULL; /* data values as doubles */ + size_t values_len = 0; // number of data points + size_t cvalues_len = 0; // coded values excluding missing + size_t i = 0; + int mode = 2; // 1=single-precision, 2=double-precision - double daverage = 0; - float faverage = 0; + double daverage = 0; + float faverage = 0; + double abs_error = 0; + double max_abs_error = 1e-04; + double tolerance = 1e-04; + double dmin; + double dmax; + float fval; FILE* in = NULL; const char* filename = 0; codes_handle* h = NULL; - if (argc!=3) {fprintf(stderr,"usage: %s mode file\n",argv[0]); return 1;} - if (strcmp(argv[1], "double")==0) mode=2; - else if (strcmp(argv[1], "float")==0) mode=1; - else { fprintf(stderr,"Invalid mode: Use float or double\n");return 1; } - filename = argv[2]; - printf( "Opening %s, mode=%s\n",filename, (mode==1?"float":"double") ); + if (argc != 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return 1; + } + filename = argv[1]; + + printf("Opening %s\n", filename); in = fopen(filename, "rb"); assert(in); - /* create new handle from the first message in the file*/ h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); assert(h); - fclose(in); - /* get the size of the values array*/ CODES_CHECK(codes_get_size(h, "values", &values_len), 0); - if (mode==1) - fvalues = (float*)malloc(values_len * sizeof(float)); - if (mode==2) - dvalues = (double*)malloc(values_len * sizeof(double)); + fvalues = (float*)malloc(values_len * sizeof(float)); + dvalues = (double*)malloc(values_len * sizeof(double)); + CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); + CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); - /* get data values*/ - if(mode==1) - CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); - if(mode==2) - CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); - - faverage = 0; - daverage = 0; - if(mode==1) { - for (i = 0; i < values_len; i++) { - if (fvalues[i] != 9999) { - //if(i<10)printf("%10.15f\n",fvalues[i]); - faverage += fvalues[i]; - cvalues_len++; - } + for (i = 0; i < values_len; i++) { + abs_error = fabs(dvalues[i] - (double)fvalues[i]); + if (abs_error > max_abs_error) { + fprintf(stderr, "ERROR:\n\tfvalue %e\n\tdvalue %e\n\terror %e\n\tmax_abs_error %e\n", fvalues[i], dvalues[i], abs_error, max_abs_error); + Assert(!"Absolute error test failed\n"); } - faverage /= (float)cvalues_len; - free(fvalues); - printf("\tThere are %zu total values, %zu coded, float average = %10.15f\n", values_len, cvalues_len, faverage); - } - if (mode==2){ - for (i = 0; i < values_len; i++) { - if (dvalues[i] != 9999) { - //if(i<10)printf("%10.15f\n",dvalues[i]); - daverage += dvalues[i]; - cvalues_len++; - } + + dmin = dvalues[i] >= 0 ? dvalues[i] / (1 + tolerance) : dvalues[i] * (1 + tolerance); + dmax = dvalues[i] >= 0 ? dvalues[i] * (1 + tolerance) : dvalues[i] / (1 + tolerance); + fval = fvalues[i]; + + if (!((dmin <= fval) && (fval <= dmax))) { + fprintf(stderr, "Error:\n"); + fprintf(stderr, "dvalue: %f, fvalue: %f\n", dvalues[i], fvalues[i]); + fprintf(stderr, "\tmin < fvalue < max = %.20e < %.20e < %.20e FAILED\n", + dmin, fvalues[i], dmax); + fprintf(stderr, "\tfvalue - min = %.20e (%s)\n", + fvalues[i] - dmin, fvalues[i] - dmin >= 0 ? "OK" : "FAILED (should be positive)"); + fprintf(stderr, "\tmax - fvalue = %.20e (%s)\n", + dmax - fvalues[i], dmax - fvalues[i] >= 0 ? "OK" : "FAILED (should be positive)"); + + Assert(!"Relative tolerance test failed\n"); } - daverage /= (double)cvalues_len; - free(dvalues); - printf("\tThere are %zu total values, %zu coded, double average = %10.15g\n", values_len, cvalues_len, daverage); } - codes_handle_delete(h); + free(fvalues); + free(dvalues); + codes_handle_delete(h); + fclose(in); return 0; } diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh index a38df98ca..15f6a3157 100755 --- a/tests/grib_ecc-1467.sh +++ b/tests/grib_ecc-1467.sh @@ -10,23 +10,40 @@ . ./include.ctest.sh -gfiles=" - sst_globus0083.grib - constant_field.grib1 - constant_field.grib2 - reduced_latlon_surface.grib1 - reduced_latlon_surface.grib2 - regular_latlon_surface.grib1 - regular_latlon_surface.grib2 -" +# Constant Fields +gfiles+="constant_field.grib1 " # grid_simple, edition=1 +gfiles+="constant_field.grib2 " # grid_simple, edition=2 + +# Grid Simple +gfiles+="sst_globus0083.grib " # grid_simple, edition=1 +gfiles+="reduced_latlon_surface.grib1 " # grid_simple, edition=1 +gfiles+="reduced_latlon_surface.grib2 " # grid_simple, edition=2 +gfiles+="regular_latlon_surface.grib1 " # grid_simple, edition=1 +gfiles+="regular_latlon_surface.grib2 " # grid_simple, edition=2 + +# Spherical Complex +gfiles+="spherical_pressure_level.grib1 " # spectral_complex, edition=1 +gfiles+="spherical_pressure_level.grib2 " # spectral_complex, edition=2 + +# Complex +#gfiles+=" "# grid_complex, edition=1 +#gfiles+="gfs.complex.mvmu.grib2 " # grid_complex, edition=2, g22order_packing + +# Second Order +#gfiles+="lfpw.grib1 " # grid_second_order, edition=1 +#gfiles+=" "# grid_second_order, edition=2 + +# CCSDS if [ $HAVE_AEC -eq 1 ]; then echo "Adding extra files (HAVE_AEC=1)" - gfiles="ccsds.grib2 "$gfiles + gfiles+="ccsds.grib2 " fi for f in $gfiles; do input=${data_dir}/$f - ${tools_dir}/grib_ls -p numberOfDataPoints,numberOfCodedValues,numberOfMissing,avg $input - $EXEC ${test_dir}/grib_ecc-1467 double $input - $EXEC ${test_dir}/grib_ecc-1467 float $input + ${tools_dir}/grib_ls -w count=1 -p numberOfDataPoints,numberOfCodedValues,numberOfMissing,avg $input + $EXEC ${test_dir}/grib_ecc-1467 $input done + + + From b8da4f1ebc178deabf102dd7cad539518adba06c Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 30 Jan 2023 14:04:47 +0000 Subject: [PATCH 044/212] ECC-1467: Minor changes --- tests/grib_ecc-1467.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh index 15f6a3157..0f9998ff0 100755 --- a/tests/grib_ecc-1467.sh +++ b/tests/grib_ecc-1467.sh @@ -25,13 +25,13 @@ gfiles+="regular_latlon_surface.grib2 " # grid_simple, edition=2 gfiles+="spherical_pressure_level.grib1 " # spectral_complex, edition=1 gfiles+="spherical_pressure_level.grib2 " # spectral_complex, edition=2 -# Complex -#gfiles+=" "# grid_complex, edition=1 +# Grid Complex +#gfiles+=" " # grid_complex, edition=1 #gfiles+="gfs.complex.mvmu.grib2 " # grid_complex, edition=2, g22order_packing # Second Order #gfiles+="lfpw.grib1 " # grid_second_order, edition=1 -#gfiles+=" "# grid_second_order, edition=2 +#gfiles+=" " # grid_second_order, edition=2 # CCSDS if [ $HAVE_AEC -eq 1 ]; then From 370f0462b3916fb8650367b1e62ae18e886c35d2 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 30 Jan 2023 15:02:26 +0000 Subject: [PATCH 045/212] ECC-1467: Complex single-precision --- ...ib_accessor_class_data_g22order_packing.cc | 251 +++++++++++++++++- tests/grib_ecc-1467.sh | 4 +- 2 files changed, 252 insertions(+), 3 deletions(-) diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index d792afaca..832172df6 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -57,6 +57,7 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_double(grib_accessor*, const double* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); @@ -121,7 +122,7 @@ static grib_accessor_class _grib_accessor_class_data_g22order_packing = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -702,6 +703,254 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + + size_t i = 0; + size_t j = 0; + long n_vals = 0; + long vcount = 0; + int err = GRIB_SUCCESS; + + long* sec_val = NULL; + grib_handle* gh = grib_handle_of_accessor(a); + + unsigned char* buf = (unsigned char*)gh->buffer->data; + unsigned char* buf_ref = NULL; + unsigned char* buf_width = NULL; + unsigned char* buf_length = NULL; + unsigned char* buf_vals = NULL; + + long length_p = 0; + long ref_p = 0; + long width_p = 0; + long vals_p = 0; + + long nvals_per_group = 0; + long nbits_per_group_val = 0; + long group_ref_val = 0; + + long bits_per_value = 0; + float binary_s = 0; + float decimal_s = 0; + double reference_value = 0; + + long binary_scale_factor; + long decimal_scale_factor; + long typeOfOriginalFieldValues; + long groupSplittingMethodUsed; + long missingValueManagementUsed; + long primaryMissingValueSubstitute; + long secondaryMissingValueSubstitute; + long numberOfGroupsOfDataValues; + long referenceForGroupWidths; + long numberOfBitsUsedForTheGroupWidths; + long referenceForGroupLengths; + long lengthIncrementForTheGroupLengths; + long trueLengthOfLastGroup; + long numberOfBitsUsedForTheScaledGroupLengths; + long orderOfSpatialDifferencing; + long numberOfOctetsExtraDescriptors; + double missingValue = 0; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if (*len < (size_t)n_vals) + return GRIB_ARRAY_TOO_SMALL; + + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) + return err; + + /* Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) + return err; + + self->dirty = 0; + + sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); + if (!sec_val) + return GRIB_OUT_OF_MEMORY; + memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ + + buf_ref = buf + a->offset; + + ref_p = (numberOfGroupsOfDataValues * bits_per_value); + + if (orderOfSpatialDifferencing) + ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); + + buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); + + width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); + buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); + + length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); + buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); + + length_p = 0; + ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; + width_p = 0; + vals_p = 0; + vcount = 0; + + for (i = 0; i < numberOfGroupsOfDataValues; i++) { + group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); + nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); + nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); + + nvals_per_group *= lengthIncrementForTheGroupLengths; + nvals_per_group += referenceForGroupLengths; + nbits_per_group_val += referenceForGroupWidths; + + if (i == numberOfGroupsOfDataValues - 1) + nvals_per_group = trueLengthOfLastGroup; + Assert(n_vals >= vcount + nvals_per_group); + + /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, + &sec_val[vcount]); */ + if (missingValueManagementUsed == 0) { + /* No explicit missing values included within data values */ + for (j = 0; j < nvals_per_group; j++) { + DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); + sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ + } + } + else if (missingValueManagementUsed == 1) { + /* Primary missing values included within data values */ + long maxn = 0; /* (1 << bits_per_value) - 1; */ + for (j = 0; j < nvals_per_group; j++) { + if (nbits_per_group_val == 0) { + maxn = (1 << bits_per_value) - 1; + if (group_ref_val == maxn) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; + } + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + if (temp == maxn) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; + } + } + } + } + else if (missingValueManagementUsed == 2) { + /* Primary and secondary missing values included within data values */ + long maxn = (1 << bits_per_value) - 1; + long maxn2 = 0; /* maxn - 1; */ + for (j = 0; j < nvals_per_group; j++) { + if (nbits_per_group_val == 0) { + maxn2 = maxn - 1; + if (group_ref_val == maxn || group_ref_val == maxn2) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; + } + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + maxn2 = maxn - 1; + if (temp == maxn || temp == maxn2) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; + } + } + } + } + + vcount += nvals_per_group; + } + + if (orderOfSpatialDifferencing) { + long bias = 0; + unsigned long extras[2] = {0,}; + ref_p = 0; + + /* For Complex packing, order == 0 */ + /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ + if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); + return GRIB_INTERNAL_ERROR; + } + + for (i = 0; i < orderOfSpatialDifferencing; i++) { + extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); + } + + bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); + + post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); + /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ + } + + binary_s = grib_power(binary_scale_factor, 2); + decimal_s = grib_power(-decimal_scale_factor, 10); + + for (i = 0; i < n_vals; i++) { + if (sec_val[i] == LONG_MAX) { + val[i] = missingValue; + } + else { + val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; + } + } + + grib_context_free(a->context, sec_val); + return err; +} + static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh index 0f9998ff0..92fe7cda3 100755 --- a/tests/grib_ecc-1467.sh +++ b/tests/grib_ecc-1467.sh @@ -26,8 +26,8 @@ gfiles+="spherical_pressure_level.grib1 " # spectral_complex, edition=1 gfiles+="spherical_pressure_level.grib2 " # spectral_complex, edition=2 # Grid Complex -#gfiles+=" " # grid_complex, edition=1 -#gfiles+="gfs.complex.mvmu.grib2 " # grid_complex, edition=2, g22order_packing +gfiles+=" " # grid_complex, edition=1 +gfiles+="gfs.complex.mvmu.grib2 " # grid_complex, edition=2, g22order_packing # Second Order #gfiles+="lfpw.grib1 " # grid_second_order, edition=1 From 213b250904d043444549e75746a24bf0641858a4 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 30 Jan 2023 15:42:24 +0000 Subject: [PATCH 046/212] ECC-1467: Cleanup debug output --- src/grib_accessor_class_data_complex_packing.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/grib_accessor_class_data_complex_packing.cc b/src/grib_accessor_class_data_complex_packing.cc index 652b7f3bf..225f8d34d 100644 --- a/src/grib_accessor_class_data_complex_packing.cc +++ b/src/grib_accessor_class_data_complex_packing.cc @@ -443,11 +443,6 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } - for (int i = n_vals-10; i < n_vals; ++i) { - printf("d: %f\n", val[i]); - } - - Assert(*len >= i); *len = i; @@ -668,10 +663,6 @@ static int unpack_float(grib_accessor* a, float* val, size_t* len) mmax++; } - for (int i = n_vals-10; i < n_vals; ++i) { - printf("f: %f\n", val[i]); - } - Assert(*len >= i); *len = i; From c6717fffabfbc1f465173fbdb1b62a48f7f3fb86 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 30 Jan 2023 15:47:48 +0000 Subject: [PATCH 047/212] ECC-1467: Basic shell constructs --- tests/grib_ecc-1467.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh index 92fe7cda3..de4ec274f 100755 --- a/tests/grib_ecc-1467.sh +++ b/tests/grib_ecc-1467.sh @@ -11,32 +11,32 @@ . ./include.ctest.sh # Constant Fields -gfiles+="constant_field.grib1 " # grid_simple, edition=1 -gfiles+="constant_field.grib2 " # grid_simple, edition=2 +gfiles="constant_field.grib1" # grid_simple, edition=1 +gfiles="$gfiles constant_field.grib2" # grid_simple, edition=2 # Grid Simple -gfiles+="sst_globus0083.grib " # grid_simple, edition=1 -gfiles+="reduced_latlon_surface.grib1 " # grid_simple, edition=1 -gfiles+="reduced_latlon_surface.grib2 " # grid_simple, edition=2 -gfiles+="regular_latlon_surface.grib1 " # grid_simple, edition=1 -gfiles+="regular_latlon_surface.grib2 " # grid_simple, edition=2 +gfiles="$gfiles sst_globus0083.grib" # grid_simple, edition=1 +gfiles="$gfiles reduced_latlon_surface.grib1" # grid_simple, edition=1 +gfiles="$gfiles reduced_latlon_surface.grib2" # grid_simple, edition=2 +gfiles="$gfiles regular_latlon_surface.grib1" # grid_simple, edition=1 +gfiles="$gfiles regular_latlon_surface.grib2" # grid_simple, edition=2 # Spherical Complex -gfiles+="spherical_pressure_level.grib1 " # spectral_complex, edition=1 -gfiles+="spherical_pressure_level.grib2 " # spectral_complex, edition=2 +gfiles="$gfiles spherical_pressure_level.grib1" # spectral_complex, edition=1 +gfiles="$gfiles spherical_pressure_level.grib2" # spectral_complex, edition=2 # Grid Complex -gfiles+=" " # grid_complex, edition=1 -gfiles+="gfs.complex.mvmu.grib2 " # grid_complex, edition=2, g22order_packing +#gfiles="$gfiles " # grid_complex, edition=1 +gfiles="$gfiles gfs.complex.mvmu.grib2" # grid_complex, edition=2, g22order_packing # Second Order -#gfiles+="lfpw.grib1 " # grid_second_order, edition=1 -#gfiles+=" " # grid_second_order, edition=2 +#gfiles="$gfiles lfpw.grib1" # grid_second_order, edition=1 +#gfiles="$gfiles " # grid_second_order, edition=2 # CCSDS if [ $HAVE_AEC -eq 1 ]; then echo "Adding extra files (HAVE_AEC=1)" - gfiles+="ccsds.grib2 " + gfiles="$gfiles ccsds.grib2" fi for f in $gfiles; do From e8e4fefed7de13cb8fa4861a1cd0cd0d40cc34b5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 31 Jan 2023 12:43:09 +0000 Subject: [PATCH 048/212] cppcheck: ctuOneDefinitionRuleViolation (grib_fieldset) --- src/grib_api_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 20751f4f9..269c2a42a 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -1270,7 +1270,7 @@ struct grib_int_array int* el; }; -#ifndef NEWDB +#if 1 struct grib_fieldset { grib_context* context; @@ -1287,7 +1287,7 @@ struct grib_fieldset }; #endif -#ifdef NEWDB +#if 0 /* grib db */ struct grib_db { From 5d288997a2444f09b39e54341ee5c345b7a767f5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 31 Jan 2023 16:33:38 +0000 Subject: [PATCH 049/212] Testing: grib_get_double_element --- tests/grib_double_cmp.cc | 2 +- tests/grib_double_cmp.sh | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/grib_double_cmp.cc b/tests/grib_double_cmp.cc index 2f943f1a6..26a5e93d7 100644 --- a/tests/grib_double_cmp.cc +++ b/tests/grib_double_cmp.cc @@ -62,8 +62,8 @@ int main(int argc, char** argv) for (i = 0; i < 100; i++) { /* get a particular data value */ GRIB_CHECK(grib_get_double_element(h, "values", i, &element_value), 0); - if (element_value != values[i]) { + printf("ERROR: element_value=%g != values[%d]=%g\n", element_value, i, values[i]); exit(1); } } diff --git a/tests/grib_double_cmp.sh b/tests/grib_double_cmp.sh index edba98d95..ca01eb02b 100755 --- a/tests/grib_double_cmp.sh +++ b/tests/grib_double_cmp.sh @@ -14,12 +14,22 @@ . ./include.ctest.sh -infile=${data_dir}/grid_ieee.grib +infiles=" + grid_ieee.grib + regular_latlon_surface_constant.grib2 + gfs.complex.mvmu.grib2 + constant_field.grib2 + missing.grib2" -# if [ ! -f ${infile} ] -# then -# echo no data to test -# exit 1 -# fi +if [ $HAVE_JPEG -eq 1 ]; then + infiles="jpeg.grib2 "$infiles +fi -$EXEC ${test_dir}/grib_double_cmp ${infile} +if [ $HAVE_AEC -eq 1 ]; then + infiles="ccsds.grib2 "$infiles +fi + +for f in $infiles; do + infile=$data_dir/$f + $EXEC ${test_dir}/grib_double_cmp ${infile} +done From 87e403b4da849efe8281fd13b7a8bf89cc695321 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 31 Jan 2023 16:44:43 +0000 Subject: [PATCH 050/212] Testing: Subset extraction without first unpacking --- tests/bufr_filter_extract_subsets.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/bufr_filter_extract_subsets.sh b/tests/bufr_filter_extract_subsets.sh index cd64e0f9e..4987ddf18 100755 --- a/tests/bufr_filter_extract_subsets.sh +++ b/tests/bufr_filter_extract_subsets.sh @@ -26,6 +26,17 @@ fBufrTmp2=temp2.${label}.bufr # Define filter rules file fRules=${label}.filter +#----------------------------------------------------------- +# Test: extract without unpacking +#----------------------------------------------------------- +set +e +echo 'set extractSubset=1; set doExtractSubsets=1;' | ${tools_dir}/codes_bufr_filter - aaen_55.bufr > $fLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Could not extract subset" $fLog +rm -f $fLog + #----------------------------------------------------------- # Test: extract subsets uncompressed data #----------------------------------------------------------- From ac303936267ae99a9b3ae103e7d2db74674098e9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 1 Feb 2023 15:52:36 +0000 Subject: [PATCH 051/212] ECC-1519: grib_ls: Using the 'statistics' namespace does not respect the specified format --- tests/grib_statistics.sh | 2 +- tools/grib_tools.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/grib_statistics.sh b/tests/grib_statistics.sh index f7503533e..5be8ed60f 100755 --- a/tests/grib_statistics.sh +++ b/tests/grib_statistics.sh @@ -45,7 +45,7 @@ input=${data_dir}/lfpw.grib1 temp1=temp1.statistics.grib temp2=temp2.statistics.grib stats=`${tools_dir}/grib_get -w count=50 -F%.2f -n statistics $input` -[ "$stats" = "10098 0 1064.19 3066.07 2.57004 4.60965 0" ] +[ "$stats" = "10098.00 0.00 1064.19 3066.07 2.57 4.61 0.00" ] # Scaling values in presence of real 9999 values ${tools_dir}/grib_set -s scaleValuesBy=0.5 $input $temp1 diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index baaf2267d..ffb33b4b8 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -756,6 +756,10 @@ static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle if (strlen(name) > options->default_print_width) options->default_print_width = (int)strlen(name); options->print_keys[options->print_keys_count].type = GRIB_TYPE_STRING; + // For the statistics namespace, do not force the type to be string. + // Setting it to undefined will use the keys' native type i.e. GRIB_TYPE_DOUBLE + if (strcmp(ns,"statistics")==0) + options->print_keys[options->print_keys_count].type = GRIB_TYPE_UNDEFINED; options->print_keys_count++; } @@ -990,7 +994,6 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type double dvalue = 0; long lvalue = 0; size_t len = MAX_STRING_LEN; - if (grib_is_missing(h, key_name, &ret) && ret == GRIB_SUCCESS) { snprintf(value_str, 32, "MISSING"); return; From b1d5fe14fb50c0fc735f2770216c3b16472d0390 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 1 Feb 2023 18:27:02 +0000 Subject: [PATCH 052/212] Testing: -w option --- tests/grib_ls.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index 88036b633..fae7d283a 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -118,6 +118,36 @@ diff $temp1 $temp2 # Section pointers grib_check_key_equals $sample_g2 'section0Pointer,section1Pointer,section3Pointer,section4Pointer' '0_16 16_21 37_72 109_34' +# constraints: -w option +file=tigge_pf_ecmwf.grib2 # Has 38 messages +${tools_dir}/grib_ls -w count!=1 $file > $temp_ls +grep -q "37 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w count=1/2/38 $file > $temp_ls +grep -q "3 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w shortName=u $file > $temp_ls +grep -q "3 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w shortName=u/v $file > $temp_ls +grep -q "5 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w shortName!=u/v $file > $temp_ls +grep -q "33 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w shortName=u/v,level=925 $file > $temp_ls +grep -q "2 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w shortName=u/v/10u/10v,level=925/10 $file > $temp_ls +grep -q "4 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w packingType!=grid_simple $file > $temp_ls +grep -q "0 of 38 messages" $temp_ls + +${tools_dir}/grib_ls -w units!=K $file > $temp_ls +grep -q "30 of 38 messages" $temp_ls + + +# Clean up rm -f $temp1 $temp2 rm -f $temp_ls From 8a0073aeb9cfd2aca4439f3a7a9f4010d3349417 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 10:38:18 +0000 Subject: [PATCH 053/212] ECC-1520: grib_filter/bufr_filter: Provide way of reading environment variables --- src/grib_expression_class_functor.cc | 37 ++++++++++++++++++++-------- tests/grib_filter.sh | 23 +++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index 8a36b68c9..91f4cdcaf 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -88,9 +88,7 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { grib_expression_functor* e = (grib_expression_functor*)g; - /* - TODO: needs OO code here - */ + // TODO: needs OO code here if (strcmp(e->name, "lookup") == 0) { return GRIB_SUCCESS; } @@ -113,16 +111,15 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) } err = grib_get_long_internal(h, p, &val); if (err) return err; - /* Note: This does not cope with keys like typeOfSecondFixedSurface - * which are codetable entries with values like 255: this value is - * not classed as 'missing'! - * (See ECC-594) - */ + // Note: This does not cope with keys like typeOfSecondFixedSurface + // which are codetable entries with values like 255: this value is + // not classed as 'missing'! + // (See ECC-594) *lres = (val == GRIB_MISSING_LONG); return GRIB_SUCCESS; } else { - /* No arguments means return the actual integer missing value */ + // No arguments means return the actual integer missing value *lres = GRIB_MISSING_LONG; } return GRIB_SUCCESS; @@ -140,6 +137,26 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) return GRIB_SUCCESS; } + if (strcmp(e->name, "environment_variable") == 0) { + // ECC-1520: This implementation has some limitations: + // 1. Cannot distinguish between environment variable NOT SET + // and SET but equal to 0 + // 2. Cannot deal with string values + const char* p = grib_arguments_get_name(h, e->args, 0); + if (p) { + char* env = getenv(p); + if (env) { + long lval = 0; + if (string_to_long(env, &lval) == GRIB_SUCCESS) { + *lres = lval; + return GRIB_SUCCESS; + } + } + } + *lres = 0; + return GRIB_SUCCESS; + } + if (strcmp(e->name, "changed") == 0) { *lres = 1; return GRIB_SUCCESS; @@ -157,7 +174,7 @@ static void print(grib_context* c, grib_expression* g, grib_handle* f) { grib_expression_functor* e = (grib_expression_functor*)g; printf("%s(", e->name); - /*grib_expression_print(c,e->args,f);*/ + // grib_expression_print(c,e->args,f); printf(")"); } diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index e85d5727b..39636c60c 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -242,6 +242,29 @@ EOF diff $tempRef $tempOut +echo "Test environment variables" +# ----------------------------------------- +input="${samp_dir}/GRIB2.tmpl" +cat >$tempFilt < $tempOut +grep -q "undefined" $tempOut +CDS=0 ${tools_dir}/grib_filter $tempFilt $input > $tempOut +grep -q "defined but equal to 0" $tempOut +# Set to a non-zero integer +CDS=1 ${tools_dir}/grib_filter $tempFilt $input > $tempOut +grep -q "defined and equal to 1" $tempOut +CDS=-42 ${tools_dir}/grib_filter $tempFilt $input > $tempOut +grep -q "defined and equal to -42" $tempOut + + echo "Test IEEE float overflow" # ----------------------------------------- input="${samp_dir}/GRIB2.tmpl" From eb780c429b66c81c85b36fa85519784b58bd4c27 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 11:16:16 +0000 Subject: [PATCH 054/212] AppVeyor: Testing --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4b0a3eaaa..863182dde 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -81,7 +81,8 @@ build_script: -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake - - cmd: ctest --output-on-failure + - cmd: ctest --output-on-failure -j2 -R download + - cmd: ctest --output-on-failure -E download - cmd: nmake install #---------------------------------# From d2962f56e9e2f9eda06731f04f9ce5e1411948a3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 11:54:08 +0000 Subject: [PATCH 055/212] AppVeyor: Try ctest in parallel --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 863182dde..0cb37f6e8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -81,8 +81,8 @@ build_script: -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake - - cmd: ctest --output-on-failure -j2 -R download - - cmd: ctest --output-on-failure -E download + - cmd: ctest --output-on-failure -j4 -R download + - cmd: ctest --output-on-failure -j4 -E download - cmd: nmake install #---------------------------------# From 665f93a8b0981cb45583a44770778ff47d2e9629 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 12:16:07 +0000 Subject: [PATCH 056/212] AppVeyor: Download in parallel fails (NMAKE : fatal error U1077) --- .appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0cb37f6e8..6dd5ff503 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -81,8 +81,8 @@ build_script: -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake - - cmd: ctest --output-on-failure -j4 -R download - - cmd: ctest --output-on-failure -j4 -E download + - cmd: ctest --output-on-failure -R download + - cmd: ctest --output-on-failure -E download -j4 - cmd: nmake install #---------------------------------# From ae3af25f6900761abf709a00ac1e89baacf5ee44 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 13:05:24 +0000 Subject: [PATCH 057/212] AppVeyor: Cannot run ctest in parallel --- .appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 6dd5ff503..4b0a3eaaa 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -81,8 +81,7 @@ build_script: -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake - - cmd: ctest --output-on-failure -R download - - cmd: ctest --output-on-failure -E download -j4 + - cmd: ctest --output-on-failure - cmd: nmake install #---------------------------------# From d25dfa82a56c16f8c5eedc412ed8a6a5dfae29db Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 16:59:06 +0000 Subject: [PATCH 058/212] ECC-1521: Drop support for 32-bit architectures --- CMakeLists.txt | 10 +++++----- eccodes_config.h.in | 1 - tests/grib_second_order.sh | 6 +----- tests/grib_sh_ieee64.sh | 4 ---- tests/include.ctest.sh.in | 1 - 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96fde7dc8..50e625c44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,11 @@ ecbuild_debug("ECCODES_BIG_ENDIAN=${ECCODES_BIG_ENDIAN}") ecbuild_debug("ECCODES_LITTLE_ENDIAN=${ECCODES_LITTLE_ENDIAN}") ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)") +# Only support 64 bit operating systems +if( NOT EC_OS_BITS EQUAL "64" ) + ecbuild_critical( "Operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- ecCodes only supports 64 bit OS's" ) +endif() + ############################################################################### # some variables/options of this project @@ -315,11 +320,6 @@ if( IEEE_LE ) set( IEEE_BE 0 ) endif() -set( ECCODES_ON_LINUX_32BIT 0 ) -if( EC_OS_NAME MATCHES "linux" AND EC_OS_BITS EQUAL "32" ) - set( ECCODES_ON_LINUX_32BIT 1 ) -endif() - set( ECCODES_ON_WINDOWS 0 ) if( EC_OS_NAME MATCHES "windows" ) # Symbols need to be explicitly exported on Windows so we can link to dlls. diff --git a/eccodes_config.h.in b/eccodes_config.h.in index 3341c4682..d80a4554d 100644 --- a/eccodes_config.h.in +++ b/eccodes_config.h.in @@ -53,7 +53,6 @@ #cmakedefine ECCODES_HAVE_REALPATH #cmakedefine ECCODES_HAVE_FSYNC #cmakedefine ECCODES_HAVE_FDATASYNC -#cmakedefine ECCODES_ON_LINUX_32BIT #if defined(EC_HAVE_ASSERT_H) || defined(ECCODES_HAVE_ASSERT_H) #define HAVE_ASSERT_H 1 diff --git a/tests/grib_second_order.sh b/tests/grib_second_order.sh index c95d50b0b..bc41a47be 100755 --- a/tests/grib_second_order.sh +++ b/tests/grib_second_order.sh @@ -153,11 +153,7 @@ grib_check_key_equals $temp3 packingType,accuracy 'grid_second_order 24' # ECC-1219: packingType conversion from grid_ieee to grid_second_order # --------------------------------------------------------------------- -if [ $ECCODES_ON_LINUX_32BIT -eq 1 ] ; then - ALLOWED_ERROR=7e-06 -else - ALLOWED_ERROR=3e-06 -fi +ALLOWED_ERROR=3e-06 if [ $ECCODES_ON_WINDOWS -eq 0 ]; then infile=grid_ieee.grib ${tools_dir}/grib_set -r -s packingType=grid_second_order $infile $temp1 diff --git a/tests/grib_sh_ieee64.sh b/tests/grib_sh_ieee64.sh index 9fcfbb4ee..cad07bad3 100755 --- a/tests/grib_sh_ieee64.sh +++ b/tests/grib_sh_ieee64.sh @@ -20,9 +20,5 @@ if [ $ECCODES_ON_WINDOWS -eq 1 ]; then echo "$0: This test is currently disabled on Windows" exit 0 fi -if [ $ECCODES_ON_LINUX_32BIT -eq 1 ]; then - echo "$0: This test is currently disabled on Linux 32 bit system" - exit 0 -fi $EXEC $test_dir/grib_sh_ieee64 diff --git a/tests/include.ctest.sh.in b/tests/include.ctest.sh.in index 8da7bf747..8832e2d0b 100644 --- a/tests/include.ctest.sh.in +++ b/tests/include.ctest.sh.in @@ -67,7 +67,6 @@ HAVE_PNG=@HAVE_PNG@ HAVE_AEC=@HAVE_AEC@ HAVE_EXTRA_TESTS=@HAVE_EXTRA_TESTS@ HAVE_MEMFS=@HAVE_MEMFS@ -ECCODES_ON_LINUX_32BIT=@ECCODES_ON_LINUX_32BIT@ ECCODES_ON_WINDOWS=@ECCODES_ON_WINDOWS@ echo "Current directory: `pwd`" From 80f83205acbb45ef4d19162c8b0eb6e22ce366c4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 17:58:34 +0000 Subject: [PATCH 059/212] ECC-1511: Remove the Python2 interface --- {python => deprecated/python}/CMakeLists.txt | 0 {python => deprecated/python}/Makefile.am | 0 {python => deprecated/python}/README | 0 {python => deprecated/python}/README.swig | 0 {python => deprecated/python}/compare_iterator_values.sh | 0 {python => deprecated/python}/create_errors.py.sh | 0 {python => deprecated/python}/eccodes/__init__.py | 0 {python => deprecated/python}/eccodes/eccodes.py | 0 {python => deprecated/python}/extrules.am | 0 {python => deprecated/python}/grib_errors.h | 0 {python => deprecated/python}/grib_interface.c | 0 {python => deprecated/python}/grib_interface.h | 0 {python => deprecated/python}/gribapi.c | 0 {python => deprecated/python}/gribapi/__init__.py | 0 {python => deprecated/python}/gribapi/errors.py | 0 {python => deprecated/python}/gribapi/gribapi.py | 0 {python => deprecated/python}/gribapi_swig.i | 0 {python => deprecated/python}/gribapi_swig.py | 0 {python => deprecated/python}/numpy.i | 0 {python => deprecated/python}/run_tests.sh | 0 {python => deprecated/python}/setup.py.autotools.in | 0 {python => deprecated/python}/setup.py.in | 0 {python => deprecated/python}/swig_wrap_numpy.c | 0 {python => deprecated/python}/swig_wrap_numpy.py | 0 {python => deprecated/python}/test_extra.py | 0 {python => deprecated/python}/test_general.py | 0 {python => deprecated/python}/test_index.py | 0 {python => deprecated/python}/test_iterator.py | 0 {python => deprecated/python}/test_keysiterator.py | 0 29 files changed, 0 insertions(+), 0 deletions(-) rename {python => deprecated/python}/CMakeLists.txt (100%) rename {python => deprecated/python}/Makefile.am (100%) rename {python => deprecated/python}/README (100%) rename {python => deprecated/python}/README.swig (100%) rename {python => deprecated/python}/compare_iterator_values.sh (100%) rename {python => deprecated/python}/create_errors.py.sh (100%) rename {python => deprecated/python}/eccodes/__init__.py (100%) rename {python => deprecated/python}/eccodes/eccodes.py (100%) rename {python => deprecated/python}/extrules.am (100%) rename {python => deprecated/python}/grib_errors.h (100%) rename {python => deprecated/python}/grib_interface.c (100%) rename {python => deprecated/python}/grib_interface.h (100%) rename {python => deprecated/python}/gribapi.c (100%) rename {python => deprecated/python}/gribapi/__init__.py (100%) rename {python => deprecated/python}/gribapi/errors.py (100%) rename {python => deprecated/python}/gribapi/gribapi.py (100%) rename {python => deprecated/python}/gribapi_swig.i (100%) rename {python => deprecated/python}/gribapi_swig.py (100%) rename {python => deprecated/python}/numpy.i (100%) rename {python => deprecated/python}/run_tests.sh (100%) rename {python => deprecated/python}/setup.py.autotools.in (100%) rename {python => deprecated/python}/setup.py.in (100%) rename {python => deprecated/python}/swig_wrap_numpy.c (100%) rename {python => deprecated/python}/swig_wrap_numpy.py (100%) rename {python => deprecated/python}/test_extra.py (100%) rename {python => deprecated/python}/test_general.py (100%) rename {python => deprecated/python}/test_index.py (100%) rename {python => deprecated/python}/test_iterator.py (100%) rename {python => deprecated/python}/test_keysiterator.py (100%) diff --git a/python/CMakeLists.txt b/deprecated/python/CMakeLists.txt similarity index 100% rename from python/CMakeLists.txt rename to deprecated/python/CMakeLists.txt diff --git a/python/Makefile.am b/deprecated/python/Makefile.am similarity index 100% rename from python/Makefile.am rename to deprecated/python/Makefile.am diff --git a/python/README b/deprecated/python/README similarity index 100% rename from python/README rename to deprecated/python/README diff --git a/python/README.swig b/deprecated/python/README.swig similarity index 100% rename from python/README.swig rename to deprecated/python/README.swig diff --git a/python/compare_iterator_values.sh b/deprecated/python/compare_iterator_values.sh similarity index 100% rename from python/compare_iterator_values.sh rename to deprecated/python/compare_iterator_values.sh diff --git a/python/create_errors.py.sh b/deprecated/python/create_errors.py.sh similarity index 100% rename from python/create_errors.py.sh rename to deprecated/python/create_errors.py.sh diff --git a/python/eccodes/__init__.py b/deprecated/python/eccodes/__init__.py similarity index 100% rename from python/eccodes/__init__.py rename to deprecated/python/eccodes/__init__.py diff --git a/python/eccodes/eccodes.py b/deprecated/python/eccodes/eccodes.py similarity index 100% rename from python/eccodes/eccodes.py rename to deprecated/python/eccodes/eccodes.py diff --git a/python/extrules.am b/deprecated/python/extrules.am similarity index 100% rename from python/extrules.am rename to deprecated/python/extrules.am diff --git a/python/grib_errors.h b/deprecated/python/grib_errors.h similarity index 100% rename from python/grib_errors.h rename to deprecated/python/grib_errors.h diff --git a/python/grib_interface.c b/deprecated/python/grib_interface.c similarity index 100% rename from python/grib_interface.c rename to deprecated/python/grib_interface.c diff --git a/python/grib_interface.h b/deprecated/python/grib_interface.h similarity index 100% rename from python/grib_interface.h rename to deprecated/python/grib_interface.h diff --git a/python/gribapi.c b/deprecated/python/gribapi.c similarity index 100% rename from python/gribapi.c rename to deprecated/python/gribapi.c diff --git a/python/gribapi/__init__.py b/deprecated/python/gribapi/__init__.py similarity index 100% rename from python/gribapi/__init__.py rename to deprecated/python/gribapi/__init__.py diff --git a/python/gribapi/errors.py b/deprecated/python/gribapi/errors.py similarity index 100% rename from python/gribapi/errors.py rename to deprecated/python/gribapi/errors.py diff --git a/python/gribapi/gribapi.py b/deprecated/python/gribapi/gribapi.py similarity index 100% rename from python/gribapi/gribapi.py rename to deprecated/python/gribapi/gribapi.py diff --git a/python/gribapi_swig.i b/deprecated/python/gribapi_swig.i similarity index 100% rename from python/gribapi_swig.i rename to deprecated/python/gribapi_swig.i diff --git a/python/gribapi_swig.py b/deprecated/python/gribapi_swig.py similarity index 100% rename from python/gribapi_swig.py rename to deprecated/python/gribapi_swig.py diff --git a/python/numpy.i b/deprecated/python/numpy.i similarity index 100% rename from python/numpy.i rename to deprecated/python/numpy.i diff --git a/python/run_tests.sh b/deprecated/python/run_tests.sh similarity index 100% rename from python/run_tests.sh rename to deprecated/python/run_tests.sh diff --git a/python/setup.py.autotools.in b/deprecated/python/setup.py.autotools.in similarity index 100% rename from python/setup.py.autotools.in rename to deprecated/python/setup.py.autotools.in diff --git a/python/setup.py.in b/deprecated/python/setup.py.in similarity index 100% rename from python/setup.py.in rename to deprecated/python/setup.py.in diff --git a/python/swig_wrap_numpy.c b/deprecated/python/swig_wrap_numpy.c similarity index 100% rename from python/swig_wrap_numpy.c rename to deprecated/python/swig_wrap_numpy.c diff --git a/python/swig_wrap_numpy.py b/deprecated/python/swig_wrap_numpy.py similarity index 100% rename from python/swig_wrap_numpy.py rename to deprecated/python/swig_wrap_numpy.py diff --git a/python/test_extra.py b/deprecated/python/test_extra.py similarity index 100% rename from python/test_extra.py rename to deprecated/python/test_extra.py diff --git a/python/test_general.py b/deprecated/python/test_general.py similarity index 100% rename from python/test_general.py rename to deprecated/python/test_general.py diff --git a/python/test_index.py b/deprecated/python/test_index.py similarity index 100% rename from python/test_index.py rename to deprecated/python/test_index.py diff --git a/python/test_iterator.py b/deprecated/python/test_iterator.py similarity index 100% rename from python/test_iterator.py rename to deprecated/python/test_iterator.py diff --git a/python/test_keysiterator.py b/deprecated/python/test_keysiterator.py similarity index 100% rename from python/test_keysiterator.py rename to deprecated/python/test_keysiterator.py From adc0450516d3154e7e4825bb6a7371bc7507c1b6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Feb 2023 19:49:48 +0000 Subject: [PATCH 060/212] ECC-1522: prgenv/amd: Test eccodes_t_grib_bpv_limit fails --- src/grib_scaling.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/grib_scaling.cc b/src/grib_scaling.cc index d5dc80719..d7654889f 100644 --- a/src/grib_scaling.cc +++ b/src/grib_scaling.cc @@ -40,16 +40,17 @@ long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret) long scale = 0; const long last = 127; /* Depends on edition, should be parameter */ unsigned long maxint = 0; + const size_t ulong_size = sizeof(maxint) * 8; /* See ECC-246 unsigned long maxint = grib_power(bpval,2) - 1; double dmaxint=(double)maxint; */ - const double dmaxint = grib_power(bpval, 2) - 1; - if (dmaxint >= ULONG_MAX) { + if (bpval >= ulong_size) { *ret = GRIB_OUT_OF_RANGE; /*overflow*/ return 0; } + const double dmaxint = grib_power(bpval, 2) - 1; maxint = (unsigned long)dmaxint; /* Now it's safe to cast */ *ret = 0; From fbb781e90b1df310aaa6c89d83164ed3b4c4db53 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Feb 2023 12:59:33 +0000 Subject: [PATCH 061/212] ECC-1521: Improved message --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50e625c44..a01e72413 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)") # Only support 64 bit operating systems if( NOT EC_OS_BITS EQUAL "64" ) - ecbuild_critical( "Operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- ecCodes only supports 64 bit OS's" ) + ecbuild_critical( "Operating system ${CMAKE_SYSTEM} (${EC_OS_BITS} bits) -- ecCodes only supports 64 bit platforms" ) endif() ############################################################################### From 083b25e6f52facf2d82b6b40696af89563e842d6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Feb 2023 15:09:35 +0000 Subject: [PATCH 062/212] Error message --- src/grib_accessor_class_data_g1simple_packing.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_accessor_class_data_g1simple_packing.cc b/src/grib_accessor_class_data_g1simple_packing.cc index 58bae890c..a9a390f13 100644 --- a/src/grib_accessor_class_data_g1simple_packing.cc +++ b/src/grib_accessor_class_data_g1simple_packing.cc @@ -288,7 +288,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) return GRIB_SUCCESS; break; case GRIB_INVALID_BPV: - grib_context_log(a->context, GRIB_LOG_ERROR, "unable to compute packing parameters. Invalid bits per value\n"); + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to compute packing parameters. Invalid bits per value"); return ret; case GRIB_SUCCESS: break; From cf73dbffeed0338ea3cdb288c43c09c446439dd8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Feb 2023 17:23:05 +0000 Subject: [PATCH 063/212] ECC-1081: level is not edition-independent for potential vorticity levels --- definitions/grib1/section.1.def | 4 ++++ src/grib_accessor_class_g2level.cc | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 974977dfd..25829af6c 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -112,6 +112,10 @@ if( indicatorOfTypeOfLevel == 109 || { alias mars.levelist = level; } +if (indicatorOfTypeOfLevel == 117) { + # See ECC-1081 + constant levelFactor = 6; +} unsigned[1] yearOfCentury : edition_specific; unsigned[1] month; diff --git a/src/grib_accessor_class_g2level.cc b/src/grib_accessor_class_g2level.cc index 4931f2f2b..d62152f53 100644 --- a/src/grib_accessor_class_g2level.cc +++ b/src/grib_accessor_class_g2level.cc @@ -292,6 +292,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) long value_first = *val; long scale_first = 0; long type_first = 0; + long levelFactor = 1; char pressure_units[10] = {0,}; size_t pressure_units_len = 10; @@ -324,6 +325,13 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (!strcmp(pressure_units, "hPa")) value_first *= 100; break; + case 109: + //printf("type1 = 109\n"); + if ((ret = grib_get_long(hand, "levelFactor", &levelFactor)) == GRIB_SUCCESS) { + // See ECC-1081 + // printf(" Special case - change scale_first to %ld\n", levelFactor); + scale_first = levelFactor; + } default: break; From 74f24a12965fb3c0e370f56aeb12830db5977acd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Feb 2023 14:12:03 +0000 Subject: [PATCH 064/212] ECC-499: Fix for generic case e.g. polar stereo --- src/grib_nearest.cc | 4 +++- tests/grib_nearest_test.sh | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/grib_nearest.cc b/src/grib_nearest.cc index ae07d598d..1bacbe767 100644 --- a/src/grib_nearest.cc +++ b/src/grib_nearest.cc @@ -437,7 +437,9 @@ int grib_nearest_find_generic( outlats[i] = neighbours[i].m_lat; outlons[i] = neighbours[i].m_lon; indexes[i] = neighbours[i].m_index; - values[i] = neighbours[i].m_value; + if (values) { + values[i] = neighbours[i].m_value; + } /*printf("(%f,%f) i=%d d=%f v=%f\n",outlats[i],outlons[i],indexes[i],distances[i],values[i]);*/ } diff --git a/tests/grib_nearest_test.sh b/tests/grib_nearest_test.sh index 1ca9e379a..6e0716afd 100755 --- a/tests/grib_nearest_test.sh +++ b/tests/grib_nearest_test.sh @@ -50,6 +50,9 @@ Idx lat lon dist EOF diff $tempRef $temp +$EXEC ${test_dir}/grib_nearest_test -n $ECCODES_SAMPLES_PATH/polar_stereographic_pl_grib2.tmpl + + # ECC-1295: regular lat/lon on ellipsoid # ---------------------------------------- sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl From 86d254da852b6849310fdf6f2bda98f877e7ea1f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Feb 2023 15:51:39 +0000 Subject: [PATCH 065/212] ECC-1523: Try downloading of test-data more persistently --- data/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 8fed17082..b91fe6be6 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,4 +1,7 @@ # data/CMakeLists.txt +set(ECBUILD_DOWNLOAD_TIMEOUT 120) +set(ECBUILD_DOWNLOAD_RETRIES 5) + add_subdirectory(tigge) add_subdirectory(bufr) add_subdirectory(metar) From ffe6168aba9a420c8c59477e52004a4570dc29c6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Feb 2023 15:52:14 +0000 Subject: [PATCH 066/212] ECC-1523: Try downloading of test-data more persistently --- data/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index b91fe6be6..1cd2b1a71 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,6 +1,6 @@ # data/CMakeLists.txt -set(ECBUILD_DOWNLOAD_TIMEOUT 120) -set(ECBUILD_DOWNLOAD_RETRIES 5) +set(ECBUILD_DOWNLOAD_TIMEOUT 60) +set(ECBUILD_DOWNLOAD_RETRIES 3) add_subdirectory(tigge) add_subdirectory(bufr) From f37fdbe40dcd23072bd73d7ad70e7e0696e1dc7c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Feb 2023 11:17:16 +0000 Subject: [PATCH 067/212] GeoIterator: Ability to not decode values --- src/grib_iterator.cc | 4 ++-- src/grib_iterator_class_gaussian_reduced.cc | 17 ++++++++------- src/grib_iterator_class_gen.cc | 11 ++++++---- ...ator_class_lambert_azimuthal_equal_area.cc | 17 ++++++++------- src/grib_iterator_class_lambert_conformal.cc | 17 ++++++++------- src/grib_iterator_class_latlon.cc | 12 +++++++---- src/grib_iterator_class_latlon_reduced.cc | 17 ++++++++------- src/grib_iterator_class_mercator.cc | 17 ++++++++------- ...grib_iterator_class_polar_stereographic.cc | 17 ++++++++------- src/grib_iterator_class_regular.cc | 21 +++++++++++-------- src/grib_iterator_class_space_view.cc | 17 ++++++++------- 11 files changed, 92 insertions(+), 75 deletions(-) diff --git a/src/grib_iterator.cc b/src/grib_iterator.cc index 7018f6b1c..0844a1fed 100644 --- a/src/grib_iterator.cc +++ b/src/grib_iterator.cc @@ -9,8 +9,8 @@ */ /*************************************************************************** - * Enrico Fucile - * Jean Baptiste Filippi - 01.11.2005 * + * Enrico Fucile * + * Jean Baptiste Filippi - 01.11.2005 * * * ***************************************************************************/ #include "grib_api_internal.h" diff --git a/src/grib_iterator_class_gaussian_reduced.cc b/src/grib_iterator_class_gaussian_reduced.cc index fd934d686..d91a05269 100644 --- a/src/grib_iterator_class_gaussian_reduced.cc +++ b/src/grib_iterator_class_gaussian_reduced.cc @@ -87,18 +87,19 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)i; + grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)iter; - if (i->e >= (long)(i->nv - 1)) + if (iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->las[i->e]; - *lon = self->los[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->las[iter->e]; + *lon = self->los[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } diff --git a/src/grib_iterator_class_gen.cc b/src/grib_iterator_class_gen.cc index cea90181b..ee9942045 100644 --- a/src/grib_iterator_class_gen.cc +++ b/src/grib_iterator_class_gen.cc @@ -114,6 +114,7 @@ int transform_iterator_data(grib_context* context, double* data, /* Already +i and +j. No need to change */ return GRIB_SUCCESS; } + if (!data) return GRIB_SUCCESS; if (!context) context = grib_context_get_default(); @@ -201,11 +202,13 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) grib_context_log(h->context, GRIB_LOG_ERROR, "Geoiterator: size(%s) is %ld", s_rawData, dli); return GRIB_WRONG_GRID; } - iter->data = (double*)grib_context_malloc(h->context, (iter->nv) * sizeof(double)); - if ((err = grib_get_double_array_internal(h, s_rawData, iter->data, &(iter->nv)))) - return err; + if (iter->flags == 0) { + iter->data = (double*)grib_context_malloc(h->context, (iter->nv) * sizeof(double)); + if ((err = grib_get_double_array_internal(h, s_rawData, iter->data, &(iter->nv)))) + return err; + } iter->e = -1; return err; @@ -226,7 +229,7 @@ static int destroy(grib_iterator* iter) static long has_next(grib_iterator* iter) { - if (iter->data == NULL) + if (iter->flags == 0 && iter->data == NULL) return 0; if (iter->e >= (long)(iter->nv - 1)) return 0; diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc index 5d54aee88..f20153e62 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc @@ -81,18 +81,19 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)i; + grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->lats[i->e]; - *lon = self->lons[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->lats[iter->e]; + *lon = self->lons[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } diff --git a/src/grib_iterator_class_lambert_conformal.cc b/src/grib_iterator_class_lambert_conformal.cc index a39b314ab..1cb34e412 100644 --- a/src/grib_iterator_class_lambert_conformal.cc +++ b/src/grib_iterator_class_lambert_conformal.cc @@ -485,18 +485,19 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return err; } -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)i; + grib_iterator_lambert_conformal* self = (grib_iterator_lambert_conformal*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->lats[i->e]; - *lon = self->lons[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->lats[iter->e]; + *lon = self->lons[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } diff --git a/src/grib_iterator_class_latlon.cc b/src/grib_iterator_class_latlon.cc index 444aa594c..bddaa2898 100644 --- a/src/grib_iterator_class_latlon.cc +++ b/src/grib_iterator_class_latlon.cc @@ -86,7 +86,7 @@ static void init_class(grib_iterator_class* c) static int next(grib_iterator* iter, double* lat, double* lon, double* val) { /* GRIB-238: Support rotated lat/lon grids */ - double ret_lat, ret_lon, ret_val; + double ret_lat, ret_lon, ret_val=0; grib_iterator_latlon* self = (grib_iterator_latlon*)iter; if ((long)iter->e >= (long)(iter->nv - 1)) @@ -101,13 +101,15 @@ static int next(grib_iterator* iter, double* lat, double* lon, double* val) /* Adjacent points in i (x) direction are consecutive */ ret_lat = self->las[(long)floor(iter->e / self->Ni)]; ret_lon = self->los[(long)iter->e % self->Ni]; - ret_val = iter->data[iter->e]; + if (iter->data) + ret_val = iter->data[iter->e]; } else { /* Adjacent points in j (y) direction is consecutive */ ret_lon = self->los[(long)iter->e / self->Nj]; ret_lat = self->las[(long)floor(iter->e % self->Nj)]; - ret_val = iter->data[iter->e]; + if (iter->data) + ret_val = iter->data[iter->e]; } /* See ECC-808: Some users want to disable the unrotate */ @@ -122,7 +124,9 @@ static int next(grib_iterator* iter, double* lat, double* lon, double* val) *lat = ret_lat; *lon = ret_lon; - *val = ret_val; + if (val && iter->data) { + *val = ret_val; + } return 1; } diff --git a/src/grib_iterator_class_latlon_reduced.cc b/src/grib_iterator_class_latlon_reduced.cc index 03f0d5e04..410884bc9 100644 --- a/src/grib_iterator_class_latlon_reduced.cc +++ b/src/grib_iterator_class_latlon_reduced.cc @@ -85,18 +85,19 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; + grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->las[i->e]; - *lon = self->los[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->las[iter->e]; + *lon = self->los[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } diff --git a/src/grib_iterator_class_mercator.cc b/src/grib_iterator_class_mercator.cc index 1690792d6..e01f3b53c 100644 --- a/src/grib_iterator_class_mercator.cc +++ b/src/grib_iterator_class_mercator.cc @@ -323,18 +323,19 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return err; } -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_mercator* self = (grib_iterator_mercator*)i; + grib_iterator_mercator* self = (grib_iterator_mercator*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->lats[i->e]; - *lon = self->lons[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->lats[iter->e]; + *lon = self->lons[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } diff --git a/src/grib_iterator_class_polar_stereographic.cc b/src/grib_iterator_class_polar_stereographic.cc index 0e3988030..10a1eccd4 100644 --- a/src/grib_iterator_class_polar_stereographic.cc +++ b/src/grib_iterator_class_polar_stereographic.cc @@ -83,18 +83,19 @@ static void init_class(grib_iterator_class* c) #define ITER "Polar stereographic Geoiterator" -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_polar_stereographic* self = (grib_iterator_polar_stereographic*)i; + grib_iterator_polar_stereographic* self = (grib_iterator_polar_stereographic*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->lats[i->e]; - *lon = self->lons[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->lats[iter->e]; + *lon = self->lons[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } diff --git a/src/grib_iterator_class_regular.cc b/src/grib_iterator_class_regular.cc index 1078243c0..d2d9e7254 100644 --- a/src/grib_iterator_class_regular.cc +++ b/src/grib_iterator_class_regular.cc @@ -99,19 +99,20 @@ static void init_class(grib_iterator_class* c) /* END_CLASS_IMP */ -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_regular* self = (grib_iterator_regular*)i; + grib_iterator_regular* self = (grib_iterator_regular*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->las[(long)floor(i->e / self->Ni)]; - *lon = self->los[(long)i->e % self->Ni]; - *val = i->data[i->e]; + iter->e++; + *lat = self->las[(long)floor(iter->e / self->Ni)]; + *lon = self->los[(long)iter->e % self->Ni]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } @@ -123,7 +124,9 @@ static int previous(grib_iterator* i, double* lat, double* lon, double* val) return 0; *lat = self->las[(long)floor(i->e / self->Ni)]; *lon = self->los[i->e % self->Ni]; - *val = i->data[i->e]; + if (val && i->data) { + *val = i->data[i->e]; + } i->e--; return 1; diff --git a/src/grib_iterator_class_space_view.cc b/src/grib_iterator_class_space_view.cc index 355acfa13..e04b3e714 100644 --- a/src/grib_iterator_class_space_view.cc +++ b/src/grib_iterator_class_space_view.cc @@ -81,18 +81,19 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ -static int next(grib_iterator* i, double* lat, double* lon, double* val) +static int next(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_space_view* self = (grib_iterator_space_view*)i; + grib_iterator_space_view* self = (grib_iterator_space_view*)iter; - if ((long)i->e >= (long)(i->nv - 1)) + if ((long)iter->e >= (long)(iter->nv - 1)) return 0; - i->e++; - - *lat = self->lats[i->e]; - *lon = self->lons[i->e]; - *val = i->data[i->e]; + iter->e++; + *lat = self->lats[iter->e]; + *lon = self->lons[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } return 1; } From 3800ad49889b342d807b8825389a96b75ad4e5b8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Feb 2023 12:16:17 +0000 Subject: [PATCH 068/212] ECC-1081: 'level' is not edition-independent for potential vorticity levels --- definitions/grib1/section.1.def | 4 ++++ src/grib_accessor_class_g2level.cc | 8 ++++++++ tests/grib_level.sh | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 974977dfd..25829af6c 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -112,6 +112,10 @@ if( indicatorOfTypeOfLevel == 109 || { alias mars.levelist = level; } +if (indicatorOfTypeOfLevel == 117) { + # See ECC-1081 + constant levelFactor = 6; +} unsigned[1] yearOfCentury : edition_specific; unsigned[1] month; diff --git a/src/grib_accessor_class_g2level.cc b/src/grib_accessor_class_g2level.cc index 4931f2f2b..d62152f53 100644 --- a/src/grib_accessor_class_g2level.cc +++ b/src/grib_accessor_class_g2level.cc @@ -292,6 +292,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) long value_first = *val; long scale_first = 0; long type_first = 0; + long levelFactor = 1; char pressure_units[10] = {0,}; size_t pressure_units_len = 10; @@ -324,6 +325,13 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (!strcmp(pressure_units, "hPa")) value_first *= 100; break; + case 109: + //printf("type1 = 109\n"); + if ((ret = grib_get_long(hand, "levelFactor", &levelFactor)) == GRIB_SUCCESS) { + // See ECC-1081 + // printf(" Special case - change scale_first to %ld\n", levelFactor); + scale_first = levelFactor; + } default: break; diff --git a/tests/grib_level.sh b/tests/grib_level.sh index 822882a8a..2847c64fd 100755 --- a/tests/grib_level.sh +++ b/tests/grib_level.sh @@ -82,6 +82,13 @@ ${tools_dir}/grib_set -s scaledValueOfFirstFixedSurface=15,scaleFactorOfFirstFix res=`${tools_dir}/grib_get -p level:d $temp` [ "$res" = "1.5" ] +# ECC-1081: 'level' is not edition-independent for potential vorticity levels +${tools_dir}/grib_set -s typeOfLevel=potentialVorticity,shortName=q,level=1500 $sample_g1 $temp +${tools_dir}/grib_set -s edition=2 $temp $temp2 +grib_check_key_equals $temp2 'mars.levelist,level,typeOfLevel' '1500 1500 potentialVorticity' +grib_check_key_equals $temp2 'scaleFactorOfFirstFixedSurface,scaledValueOfFirstFixedSurface' '6 1500' + + # GRIB-637 grib2 Potential vorticity surface input=${data_dir}/tigge_pf_ecmwf.grib2 res=`${tools_dir}/grib_get -wcount=7 -F%.20f -p level:d $input` From 5d8bfc5728cd812e83bba6c5f1b6599c2a9de094 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Feb 2023 13:00:14 +0000 Subject: [PATCH 069/212] ECC-1081: Cleanup --- src/grib_accessor_class_g2level.cc | 66 ++++++++++++++---------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/src/grib_accessor_class_g2level.cc b/src/grib_accessor_class_g2level.cc index d62152f53..18b0bcad7 100644 --- a/src/grib_accessor_class_g2level.cc +++ b/src/grib_accessor_class_g2level.cc @@ -182,7 +182,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) *val = 0; return GRIB_SUCCESS; } - /* value = value_first * 10 ^ -scale_first */ + // value = value_first * 10 ^ -scale_first if (*len < 1) return GRIB_WRONG_ARRAY_SIZE; @@ -190,7 +190,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) v = value_first; if (scale_first != GRIB_MISSING_LONG) { - /* GRIB-637 Potential vorticity surface */ + // GRIB-637 Potential vorticity surface if (type_first == 109) { scale_first -= 6; } @@ -206,11 +206,11 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } switch (type_first) { - case 100: /* Isobaric surface (Pa) */ + case 100: // Isobaric surface (Pa) if (!strcmp(pressure_units, "hPa")) { - long x = v / 100.0; /* 1 hPa = 100 Pa */ + long x = v / 100.0; // 1 hPa = 100 Pa if (scale_first == 0 && x == 0) { - /* Switch to Pa instead of hPa as the value is less than a hectoPascal */ + // Switch to Pa instead of hPa as the value is less than a hectoPascal char pa[] = "Pa"; size_t lpa = strlen(pa); if ((ret = grib_set_string_internal(grib_handle_of_accessor(a), self->pressure_units, pa, &lpa)) != GRIB_SUCCESS) @@ -233,7 +233,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) double dval = 0; int ret = unpack_double(a, &dval, len); if (ret == GRIB_SUCCESS) { - *val = (long)(dval + 0.5); /* round up */ + *val = (long)(dval + 0.5); // round up } return ret; } @@ -258,7 +258,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return ret; switch (type_first) { - case 100: /* Pa */ + case 100: // Pa if (!strcmp(pressure_units, "hPa")) value_first *= 100; break; @@ -266,12 +266,12 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) default: break; } - /* - * final = scaled_value * 10 ^ -scale_factor - * = scaled_value / (10^scale_factor) - * - * Choose 2 decimal places - */ + // + // final = scaled_value * 10 ^ -scale_factor + // = scaled_value / (10^scale_factor) + // + // Choose 2 decimal places + // scale_first = 2; value_first *= 100; value_first = value_first + 0.5; /* round up */ @@ -303,15 +303,14 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; - /*Not sure if this is necessary - * if (value_first == GRIB_MISSING_LONG) { - * if ((ret=grib_set_missing_internal(hand, self->scale_first)) != GRIB_SUCCESS) - * return ret; - * if ((ret=grib_set_missing_internal(hand, self->value_first)) != GRIB_SUCCESS) - * return ret; - * return GRIB_SUCCESS; - * } - */ + // Not sure if this is necessary + // if (value_first == GRIB_MISSING_LONG) { + // if ((ret=grib_set_missing_internal(hand, self->scale_first)) != GRIB_SUCCESS) + // return ret; + // if ((ret=grib_set_missing_internal(hand, self->value_first)) != GRIB_SUCCESS) + // return ret; + // return GRIB_SUCCESS; + // } if ((ret = grib_get_long_internal(hand, self->type_first, &type_first)) != GRIB_SUCCESS) return ret; @@ -320,16 +319,14 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return ret; switch (type_first) { - case 100: /* Pa */ + case 100: // Pa scale_first = 0; if (!strcmp(pressure_units, "hPa")) value_first *= 100; break; case 109: - //printf("type1 = 109\n"); if ((ret = grib_get_long(hand, "levelFactor", &levelFactor)) == GRIB_SUCCESS) { // See ECC-1081 - // printf(" Special case - change scale_first to %ld\n", levelFactor); scale_first = levelFactor; } @@ -337,16 +334,15 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) break; } - /* ECC-530: - * The pack_long function can get called when key "typeOfSecondFixedSurface" is - * changed (via the trigger rule in the definitions). That can have an undesired - * side-effect that it sets the scale factor and scaled value keys - * (e.g. scaleFactorOfFirstFixedSurface, scaledValueOfFirstFixedSurface) - * overwriting their previous values. - * In this scenario we do not want to change the scale/value. - * However when the user directly sets the level or when we are changing edition, then - * we do want to change the scale/value. - */ + // ECC-530: + // The pack_long function can get called when key "typeOfSecondFixedSurface" is + // changed (via the trigger rule in the definitions). That can have an undesired + // side-effect that it sets the scale factor and scaled value keys + // (e.g. scaleFactorOfFirstFixedSurface, scaledValueOfFirstFixedSurface) + // overwriting their previous values. + // In this scenario we do not want to change the scale/value. + // However when the user directly sets the level or when we are changing edition, then + // we do want to change the scale/value. #if 0 if (hand->loader && hand->loader->changing_edition==0) { change_scale_and_value = 0; From d2e857e84224b8d448cd93a1402e016ef5478d86 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Feb 2023 20:41:18 +0000 Subject: [PATCH 070/212] Cleanup --- src/grib_io.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/grib_io.cc b/src/grib_io.cc index 3e7ac6264..da16be6d4 100644 --- a/src/grib_io.cc +++ b/src/grib_io.cc @@ -341,10 +341,8 @@ static int read_GRIB(reader* r) } /* fprintf(stderr,"%s sec1len=%d i=%d\n",type,sec1len,i); */ - GROW_BUF_IF_REQUIRED(sec1len + sec2len + sec3len + 4 + 3); - for (j = 0; j < 3; j++) { if (r->read(r->read_data, &tmp[i], 1, &err) != 1 || err) return err; From 9b81223df368371a3b5c9f49c39a6dcdddd27d10 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Feb 2023 15:26:15 +0000 Subject: [PATCH 071/212] Speedy Geoiterator: Add new flag --- src/eccodes.h | 21 ++++++++++++--------- src/grib_api.h | 18 +++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/eccodes.h b/src/eccodes.h index 68f97b58b..6eff46f6f 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -28,19 +28,19 @@ extern "C" { /* sections */ #define CODES_SECTION_PRODUCT GRIB_SECTION_PRODUCT -#define CODES_SECTION_GRID GRIB_SECTION_GRID -#define CODES_SECTION_LOCAL GRIB_SECTION_LOCAL -#define CODES_SECTION_DATA GRIB_SECTION_DATA -#define CODES_SECTION_BITMAP GRIB_SECTION_BITMAP +#define CODES_SECTION_GRID GRIB_SECTION_GRID +#define CODES_SECTION_LOCAL GRIB_SECTION_LOCAL +#define CODES_SECTION_DATA GRIB_SECTION_DATA +#define CODES_SECTION_BITMAP GRIB_SECTION_BITMAP /* LOG MODES -Log mode for information for processing information +Log mode for processing information */ -#define CODES_LOG_INFO GRIB_LOG_INFO +#define CODES_LOG_INFO GRIB_LOG_INFO #define CODES_LOG_WARNING GRIB_LOG_WARNING -#define CODES_LOG_ERROR GRIB_LOG_ERROR -#define CODES_LOG_FATAL GRIB_LOG_FATAL -#define CODES_LOG_DEBUG GRIB_LOG_DEBUG +#define CODES_LOG_ERROR GRIB_LOG_ERROR +#define CODES_LOG_FATAL GRIB_LOG_FATAL +#define CODES_LOG_DEBUG GRIB_LOG_DEBUG /* Types */ #define CODES_TYPE_UNDEFINED GRIB_TYPE_UNDEFINED @@ -74,6 +74,9 @@ Log mode for information for processing information #define CODES_NEAREST_SAME_DATA GRIB_NEAREST_SAME_DATA #define CODES_NEAREST_SAME_POINT GRIB_NEAREST_SAME_POINT +/* Geoiterator flags */ +#define CODES_GEOITERATOR_NO_VALUES GRIB_GEOITERATOR_NO_VALUES + /*! Iteration is carried out on all the keys available in the message \ingroup keys_iterator \see codes_keys_iterator_new diff --git a/src/grib_api.h b/src/grib_api.h index 471754ee1..816b97d58 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -10,7 +10,6 @@ /*! \file grib_api.h \brief grib_api C header file - */ #ifndef grib_api_H @@ -58,9 +57,7 @@ extern "C" { #define GRIB_SECTION_BITMAP (1 << 4) -/* LOG MODES -Log mode for information for processing information -*/ +/* Log modes for processing information */ /* Log mode for info */ #define GRIB_LOG_INFO 0 /* Log mode for warnings */ @@ -93,10 +90,10 @@ Log mode for information for processing information /* Missing values */ /* #define GRIB_MISSING_LONG 0x80000001 */ /* #define GRIB_MISSING_LONG 0xffffffff */ -#define GRIB_MISSING_LONG 2147483647 +#define GRIB_MISSING_LONG 2147483647 #define GRIB_MISSING_DOUBLE -1e+100 -/* Dump option flags*/ +/* Dump option flags */ #define GRIB_DUMP_FLAG_READ_ONLY (1 << 0) #define GRIB_DUMP_FLAG_DUMP_OK (1 << 1) #define GRIB_DUMP_FLAG_VALUES (1 << 2) @@ -114,6 +111,9 @@ Log mode for information for processing information #define GRIB_NEAREST_SAME_DATA (1 << 1) #define GRIB_NEAREST_SAME_POINT (1 << 2) +/* Geoiterator flags */ +#define GRIB_GEOITERATOR_NO_VALUES (1 << 0) + /*! Iteration is carried out on all the keys available in the message \ingroup keys_iterator \see grib_keys_iterator_new @@ -179,17 +179,17 @@ struct grib_values }; -/*! Grib handle, structure giving access to parsed message values by keys +/*! Grib handle, structure giving access to parsed message values by keys \ingroup grib_handle */ typedef struct grib_handle grib_handle; -/*! Grib multi field handle, structure used to build multi-field GRIB messages. +/*! Grib multi field handle, structure used to build multi-field GRIB messages. \ingroup grib_handle */ typedef struct grib_multi_handle grib_multi_handle; -/*! Grib context, structure containing the memory methods, the parsers and the formats. +/*! Grib context, structure containing the memory methods, the parsers and the formats. \ingroup grib_context */ typedef struct grib_context grib_context; From 1c761ec0df7983a5f188c7c14c6a12fd62288870 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Feb 2023 17:33:51 +0000 Subject: [PATCH 072/212] Speedy Geoiterator: Compute lats and lons without decoding. Added test too --- src/grib_accessor_class_latitudes.cc | 23 +++++++----- src/grib_accessor_class_longitudes.cc | 19 ++++++---- src/grib_iterator_class_gen.cc | 5 ++- tests/grib_geo_iter.cc | 53 +++++++++++++++++++++------ tests/grib_geo_iter.sh | 31 +++++++++++++++- 5 files changed, 100 insertions(+), 31 deletions(-) diff --git a/src/grib_accessor_class_latitudes.cc b/src/grib_accessor_class_latitudes.cc index 90f6601bf..96c529d8e 100644 --- a/src/grib_accessor_class_latitudes.cc +++ b/src/grib_accessor_class_latitudes.cc @@ -188,11 +188,11 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_context* c = a->context; grib_accessor_latitudes* self = (grib_accessor_latitudes*)a; - int ret = 0; - double* v = val; - double dummyLon = 0, dummyVal = 0; - size_t size = 0; - long count = 0; + int ret = 0; + double* v = val; + double dummyLon = 0; + size_t size = 0; + long count = 0; grib_iterator* iter = NULL; self->save = 1; @@ -221,7 +221,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } - iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + // Performance: We do not need the values to be decoded + iter = grib_iterator_new(grib_handle_of_accessor(a), GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); @@ -229,7 +230,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } - while (grib_iterator_next(iter, v++, &dummyLon, &dummyVal)) {} + while (grib_iterator_next(iter, v++, &dummyLon, NULL)) {} grib_iterator_delete(iter); *len = size; @@ -275,13 +276,15 @@ static int get_distinct(grib_accessor* a, double** val, long* len) double prev; double* v = NULL; double* v1 = NULL; - double dummyLon = 0, dummyVal = 0; + double dummyLon = 0; int ret = 0; int i; long jScansPositively = 0; /* default: north to south */ size_t size = *len; grib_context* c = a->context; - grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + + // Performance: We do not need the values to be decoded + grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); @@ -295,7 +298,7 @@ static int get_distinct(grib_accessor* a, double** val, long* len) } *val = v; - while (grib_iterator_next(iter, v++, &dummyLon, &dummyVal)) {} + while (grib_iterator_next(iter, v++, &dummyLon, NULL)) {} grib_iterator_delete(iter); v = *val; diff --git a/src/grib_accessor_class_longitudes.cc b/src/grib_accessor_class_longitudes.cc index 03f08f6be..e12a622ed 100644 --- a/src/grib_accessor_class_longitudes.cc +++ b/src/grib_accessor_class_longitudes.cc @@ -165,9 +165,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_accessor_longitudes* self = (grib_accessor_longitudes*)a; int ret = 0; double* v = val; - double dummyLat = 0, dummyVal = 0; - size_t size = 0; - long count = 0; + double dummyLat = 0; + size_t size = 0; + long count = 0; grib_iterator* iter = NULL; self->save = 1; @@ -197,7 +197,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } - iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + // Performance: We do not need the values to be decoded + iter = grib_iterator_new(grib_handle_of_accessor(a), GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); @@ -205,7 +206,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return ret; } - while (grib_iterator_next(iter, &dummyLat, v++, &dummyVal)) {} + while (grib_iterator_next(iter, &dummyLat, v++, NULL)) {} grib_iterator_delete(iter); *len = size; @@ -250,12 +251,14 @@ static int get_distinct(grib_accessor* a, double** val, long* len) double prev; double* v = NULL; double* v1 = NULL; - double dummyLat = 0, dummyVal = 0; + double dummyLat = 0; int ret = 0; int i; size_t size = *len; grib_context* c = a->context; - grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), 0, &ret); + + // Performance: We do not need the values to be decoded + grib_iterator* iter = grib_iterator_new(grib_handle_of_accessor(a), GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { if (iter) grib_iterator_delete(iter); @@ -269,7 +272,7 @@ static int get_distinct(grib_accessor* a, double** val, long* len) } *val = v; - while (grib_iterator_next(iter, &dummyLat, v++, &dummyVal)) {} + while (grib_iterator_next(iter, &dummyLat, v++, NULL)) {} grib_iterator_delete(iter); v = *val; diff --git a/src/grib_iterator_class_gen.cc b/src/grib_iterator_class_gen.cc index ee9942045..acdf425a8 100644 --- a/src/grib_iterator_class_gen.cc +++ b/src/grib_iterator_class_gen.cc @@ -184,6 +184,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->missingValue = grib_arguments_get_name(h, args, self->carg++); s_rawData = grib_arguments_get_name(h, args, self->carg++); + iter->data = NULL; iter->h = h; /* We may not need to keep them */ iter->args = args; if ((err = grib_get_size(h, s_rawData, &dli)) != GRIB_SUCCESS) @@ -203,7 +204,9 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return GRIB_WRONG_GRID; } - if (iter->flags == 0) { + if ((iter->flags & GRIB_GEOITERATOR_NO_VALUES) == 0) { + // When the NO_VALUES flag is unset, decode the values and store them in the iterator. + // By default (and legacy) flags==0, so we decode iter->data = (double*)grib_context_malloc(h->context, (iter->nv) * sizeof(double)); if ((err = grib_get_double_array_internal(h, s_rawData, iter->data, &(iter->nv)))) diff --git a/tests/grib_geo_iter.cc b/tests/grib_geo_iter.cc index fb8482632..28b7603fe 100644 --- a/tests/grib_geo_iter.cc +++ b/tests/grib_geo_iter.cc @@ -13,29 +13,60 @@ #include "grib_api_internal.h" +typedef enum IterMode +{ + WITH_VALUES, + NO_VALUES +} IterMode; + int main(int argc, char** argv) { int err = 0; - double lat, lon, value; - int n = 0; - const int numberOfDataPoints = 13280; - const char* sample_filename = "gg_sfc_grib2"; - grib_handle* h = NULL; - grib_iterator* iter = NULL; - - h = grib_handle_new_from_samples(0, sample_filename); + double lat = 0, lon = 0, value = 0; + long n = 0, numberOfDataPoints = 0; + char* filename = NULL; + FILE* fin = NULL; + grib_handle* h = NULL; + grib_iterator* iter = NULL; + char* option = NULL; + IterMode mode = WITH_VALUES; + int flags = 0; + double* pValue = NULL; + bool verbose = false; + + Assert(argc == 3); + option = argv[1]; + filename = argv[2]; + if (strcmp(option, "-n")==0) { + mode = NO_VALUES; + } + + fin = fopen(filename, "rb"); + Assert(fin); + h = grib_handle_new_from_file(0, fin, &err); + Assert(!err); Assert(h); - iter = grib_iterator_new(h, 0, &err); + GRIB_CHECK(grib_get_long(h,"numberOfDataPoints", &numberOfDataPoints),0); + + flags = (mode == NO_VALUES) ? GRIB_GEOITERATOR_NO_VALUES : 0; + iter = grib_iterator_new(h, flags, &err); Assert(!err); Assert(iter); Assert(grib_iterator_has_next(iter)); n = 0; - while (grib_iterator_next(iter, &lat, &lon, &value)) { - if (n < numberOfDataPoints - 1) + pValue = (mode == NO_VALUES) ? NULL : &value; + while (grib_iterator_next(iter, &lat, &lon, pValue)) { + if (n < numberOfDataPoints - 1) { Assert(grib_iterator_has_next(iter)); + } + if (verbose) { + printf("%9.3f %9.3f ",lat, lon); + if (pValue) printf(" %.10e\n", *pValue); + else printf("\n"); + } n++; } Assert(n == numberOfDataPoints); diff --git a/tests/grib_geo_iter.sh b/tests/grib_geo_iter.sh index 4c3af0c86..631d2485b 100755 --- a/tests/grib_geo_iter.sh +++ b/tests/grib_geo_iter.sh @@ -12,4 +12,33 @@ label="grib_geo_iter_test" -$EXEC ${test_dir}/grib_geo_iter +infiles=" + $ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl + $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl + $ECCODES_SAMPLES_PATH/regular_gg_ml_grib2.tmpl + $ECCODES_SAMPLES_PATH/polar_stereographic_pl_grib2.tmpl + $data_dir/regular_latlon_surface.grib1 + $data_dir/mercator.grib2 +" + +# Run the iterator in two modes: +# -v decodes the values +# -n does not decode the values +infile=$ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl +for infile in $infiles; do + $EXEC ${test_dir}/grib_geo_iter -v $infile + $EXEC ${test_dir}/grib_geo_iter -n $infile +done + +# Test a case where decoding is not possible but the iterator would work +if [ $HAVE_JPEG -eq 0 ]; then + # No JPEG, so cannot decode the field but the iterator doesn't need to + infile=$data_dir/jpeg.grib2 + set +e + ${tools_dir}/grib_get -p min,max $infile + status=$? + set -e + [ $status -ne 0 ] # Make sure it fails to decode + + $EXEC ${test_dir}/grib_geo_iter -n $infile +fi From 4203aab84df35591b7be16e7ebc510410e8add33 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Feb 2023 19:30:39 +0000 Subject: [PATCH 073/212] Return value should be GRIB_SUCCESS --- src/grib_iterator_class_gaussian_reduced.cc | 8 +++--- src/grib_iterator_class_gen.cc | 2 +- ...ator_class_lambert_azimuthal_equal_area.cc | 8 +++--- src/grib_iterator_class_lambert_conformal.cc | 2 +- src/grib_iterator_class_latlon_reduced.cc | 18 ++++++------- src/grib_iterator_class_mercator.cc | 8 +++--- ...grib_iterator_class_polar_stereographic.cc | 2 +- src/grib_iterator_class_regular.cc | 26 +++++++++---------- src/grib_iterator_class_space_view.cc | 8 +++--- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/grib_iterator_class_gaussian_reduced.cc b/src/grib_iterator_class_gaussian_reduced.cc index d91a05269..95608dd91 100644 --- a/src/grib_iterator_class_gaussian_reduced.cc +++ b/src/grib_iterator_class_gaussian_reduced.cc @@ -413,12 +413,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return ret; } -static int destroy(grib_iterator* i) +static int destroy(grib_iterator* iter) { - grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)i; - const grib_context* c = i->h->context; + grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)iter; + const grib_context* c = iter->h->context; grib_context_free(c, self->las); grib_context_free(c, self->los); - return 1; + return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_gen.cc b/src/grib_iterator_class_gen.cc index acdf425a8..c8ae72365 100644 --- a/src/grib_iterator_class_gen.cc +++ b/src/grib_iterator_class_gen.cc @@ -227,7 +227,7 @@ static int destroy(grib_iterator* iter) { const grib_context* c = iter->h->context; grib_context_free(c, iter->data); - return 1; + return GRIB_SUCCESS; } static long has_next(grib_iterator* iter) diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc index f20153e62..f77b23afc 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc @@ -487,12 +487,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return GRIB_SUCCESS; } -static int destroy(grib_iterator* i) +static int destroy(grib_iterator* iter) { - grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)i; - const grib_context* c = i->h->context; + grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)iter; + const grib_context* c = iter->h->context; grib_context_free(c, self->lats); grib_context_free(c, self->lons); - return 1; + return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_lambert_conformal.cc b/src/grib_iterator_class_lambert_conformal.cc index 1cb34e412..8c5fed223 100644 --- a/src/grib_iterator_class_lambert_conformal.cc +++ b/src/grib_iterator_class_lambert_conformal.cc @@ -508,5 +508,5 @@ static int destroy(grib_iterator* i) grib_context_free(c, self->lats); grib_context_free(c, self->lons); - return 1; + return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_latlon_reduced.cc b/src/grib_iterator_class_latlon_reduced.cc index 410884bc9..90154ff22 100644 --- a/src/grib_iterator_class_latlon_reduced.cc +++ b/src/grib_iterator_class_latlon_reduced.cc @@ -101,9 +101,9 @@ static int next(grib_iterator* iter, double* lat, double* lon, double* val) return 1; } -static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; + grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)iter; int ret = GRIB_SUCCESS; double laf; @@ -149,8 +149,8 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) pl = (long*)grib_context_malloc(h->context, plsize * sizeof(long)); grib_get_long_array_internal(h, plac, pl, &plsize); - self->las = (double*)grib_context_malloc(h->context, i->nv * sizeof(double)); - self->los = (double*)grib_context_malloc(h->context, i->nv * sizeof(double)); + self->las = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); + self->los = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); plmax = pl[0]; for (j = 0; j < nlats; j++) @@ -193,18 +193,18 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) laf += jdirinc; } - i->e = -1; + iter->e = -1; grib_context_free(h->context, pl); return ret; } -static int destroy(grib_iterator* i) +static int destroy(grib_iterator* iter) { - grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)i; - const grib_context* c = i->h->context; + grib_iterator_latlon_reduced* self = (grib_iterator_latlon_reduced*)iter; + const grib_context* c = iter->h->context; grib_context_free(c, self->las); grib_context_free(c, self->los); - return 1; + return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_mercator.cc b/src/grib_iterator_class_mercator.cc index e01f3b53c..fd67bd833 100644 --- a/src/grib_iterator_class_mercator.cc +++ b/src/grib_iterator_class_mercator.cc @@ -339,12 +339,12 @@ static int next(grib_iterator* iter, double* lat, double* lon, double* val) return 1; } -static int destroy(grib_iterator* i) +static int destroy(grib_iterator* iter) { - grib_iterator_mercator* self = (grib_iterator_mercator*)i; - const grib_context* c = i->h->context; + grib_iterator_mercator* self = (grib_iterator_mercator*)iter; + const grib_context* c = iter->h->context; grib_context_free(c, self->lats); grib_context_free(c, self->lons); - return 1; + return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_polar_stereographic.cc b/src/grib_iterator_class_polar_stereographic.cc index 10a1eccd4..1f8b0d17b 100644 --- a/src/grib_iterator_class_polar_stereographic.cc +++ b/src/grib_iterator_class_polar_stereographic.cc @@ -371,5 +371,5 @@ static int destroy(grib_iterator* i) grib_context_free(c, self->lats); grib_context_free(c, self->lons); - return 1; + return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_regular.cc b/src/grib_iterator_class_regular.cc index d2d9e7254..ce45da00a 100644 --- a/src/grib_iterator_class_regular.cc +++ b/src/grib_iterator_class_regular.cc @@ -116,34 +116,34 @@ static int next(grib_iterator* iter, double* lat, double* lon, double* val) return 1; } -static int previous(grib_iterator* i, double* lat, double* lon, double* val) +static int previous(grib_iterator* iter, double* lat, double* lon, double* val) { - grib_iterator_regular* self = (grib_iterator_regular*)i; + grib_iterator_regular* self = (grib_iterator_regular*)iter; - if (i->e < 0) + if (iter->e < 0) return 0; - *lat = self->las[(long)floor(i->e / self->Ni)]; - *lon = self->los[i->e % self->Ni]; - if (val && i->data) { - *val = i->data[i->e]; + *lat = self->las[(long)floor(iter->e / self->Ni)]; + *lon = self->los[iter->e % self->Ni]; + if (val && iter->data) { + *val = iter->data[iter->e]; } - i->e--; + iter->e--; return 1; } -static int destroy(grib_iterator* i) +static int destroy(grib_iterator* iter) { - grib_iterator_regular* self = (grib_iterator_regular*)i; - const grib_context* c = i->h->context; + grib_iterator_regular* self = (grib_iterator_regular*)iter; + const grib_context* c = iter->h->context; grib_context_free(c, self->las); grib_context_free(c, self->los); return GRIB_SUCCESS; } -static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) { - grib_iterator_regular* self = (grib_iterator_regular*)i; + grib_iterator_regular* self = (grib_iterator_regular*)iter; int ret = GRIB_SUCCESS; long Ni; /* Number of points along a parallel = Nx */ diff --git a/src/grib_iterator_class_space_view.cc b/src/grib_iterator_class_space_view.cc index e04b3e714..70299278b 100644 --- a/src/grib_iterator_class_space_view.cc +++ b/src/grib_iterator_class_space_view.cc @@ -378,12 +378,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return ret; } -static int destroy(grib_iterator* i) +static int destroy(grib_iterator* iter) { - grib_iterator_space_view* self = (grib_iterator_space_view*)i; - const grib_context* c = i->h->context; + grib_iterator_space_view* self = (grib_iterator_space_view*)iter; + const grib_context* c = iter->h->context; grib_context_free(c, self->lats); grib_context_free(c, self->lons); - return 1; + return GRIB_SUCCESS; } From 54cfd30b29221b43d0f8e35c217515d1b1f68c7b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Feb 2023 12:41:09 +0000 Subject: [PATCH 074/212] ECC-1525: Performance: Getting keys 'latitudes' and 'longitudes' should not decode the field values --- src/grib_accessor_class_latitudes.cc | 2 +- src/grib_accessor_class_longitudes.cc | 2 +- src/grib_iterator_class_gen.cc | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/grib_accessor_class_latitudes.cc b/src/grib_accessor_class_latitudes.cc index 96c529d8e..eff57ed3c 100644 --- a/src/grib_accessor_class_latitudes.cc +++ b/src/grib_accessor_class_latitudes.cc @@ -221,7 +221,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } - // Performance: We do not need the values to be decoded + // ECC-1525 Performance: We do not need the values to be decoded iter = grib_iterator_new(grib_handle_of_accessor(a), GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { if (iter) diff --git a/src/grib_accessor_class_longitudes.cc b/src/grib_accessor_class_longitudes.cc index e12a622ed..e17cef001 100644 --- a/src/grib_accessor_class_longitudes.cc +++ b/src/grib_accessor_class_longitudes.cc @@ -197,7 +197,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } - // Performance: We do not need the values to be decoded + // ECC-1525 Performance: We do not need the values to be decoded iter = grib_iterator_new(grib_handle_of_accessor(a), GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { if (iter) diff --git a/src/grib_iterator_class_gen.cc b/src/grib_iterator_class_gen.cc index c8ae72365..02fe38c28 100644 --- a/src/grib_iterator_class_gen.cc +++ b/src/grib_iterator_class_gen.cc @@ -205,12 +205,14 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } if ((iter->flags & GRIB_GEOITERATOR_NO_VALUES) == 0) { + // ECC-1525 // When the NO_VALUES flag is unset, decode the values and store them in the iterator. // By default (and legacy) flags==0, so we decode iter->data = (double*)grib_context_malloc(h->context, (iter->nv) * sizeof(double)); - if ((err = grib_get_double_array_internal(h, s_rawData, iter->data, &(iter->nv)))) + if ((err = grib_get_double_array_internal(h, s_rawData, iter->data, &(iter->nv)))) { return err; + } } iter->e = -1; From e0c4218790de1c494369125792eb6cd1e64319e5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Feb 2023 13:14:24 +0000 Subject: [PATCH 075/212] Remove unused function --- src/eccodes_prototypes.h | 1 - src/grib_util.cc | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index fd2f74ba3..8113e2615 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1434,7 +1434,6 @@ grib_string_list* grib_util_get_param_id(const char* mars_param); grib_string_list* grib_util_get_mars_param(const char* param_id); grib_handle* grib_util_set_spec(grib_handle* h, const grib_util_grid_spec* spec, const grib_util_packing_spec* packing_spec, int flags, const double* data_values, size_t data_values_count, int* err); grib_handle* grib_util_set_spec2(grib_handle* h, const grib_util_grid_spec2* spec, const grib_util_packing_spec* packing_spec, int flags, const double* data_values, size_t data_values_count, int* err); -int grib_moments(grib_handle* h, double east, double north, double west, double south, int order, double* moments, long* count); int parse_keyval_string(const char* grib_tool, char* arg, int values_required, int default_type, grib_values values[], int* count); int grib2_is_PDTN_EPS(long productDefinitionTemplateNumber); int grib2_is_PDTN_Chemical(long productDefinitionTemplateNumber); diff --git a/src/grib_util.cc b/src/grib_util.cc index e017e6d4e..cc16e6090 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1623,7 +1623,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, grib_handle_delete(h_out); return NULL; } - +#if 0 int grib_moments(grib_handle* h, double east, double north, double west, double south, int order, double* moments, long* count) { grib_iterator* iter = NULL; @@ -1710,6 +1710,7 @@ int grib_moments(grib_handle* h, double east, double north, double west, double return ret; } +#endif /* Helper function for 'parse_keyval_string' */ static void set_value(grib_values* value, char* str, int equal) From 3710b22999149a730bb9fcee04aaec7a8d2ddc07 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Feb 2023 13:17:17 +0000 Subject: [PATCH 076/212] Cleanup --- src/grib_expression_class_functor.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index 91f4cdcaf..5c9d9c3ca 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -88,7 +88,6 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres) { grib_expression_functor* e = (grib_expression_functor*)g; - // TODO: needs OO code here if (strcmp(e->name, "lookup") == 0) { return GRIB_SUCCESS; } From a34af79897ca59b558100112df4cadc0a498482d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Feb 2023 17:25:44 +0000 Subject: [PATCH 077/212] ECC-1526: Performance: Unnecessary decoding during nearest neighbour computation --- src/grib_nearest_class_latlon_reduced.cc | 5 ++--- src/grib_nearest_class_reduced.cc | 5 ++--- src/grib_nearest_class_regular.cc | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/grib_nearest_class_latlon_reduced.cc b/src/grib_nearest_class_latlon_reduced.cc index fc682ed05..9262723c6 100644 --- a/src/grib_nearest_class_latlon_reduced.cc +++ b/src/grib_nearest_class_latlon_reduced.cc @@ -182,7 +182,6 @@ static int find_global(grib_nearest* nearest, grib_handle* h, * This is for performance: if the grid has not changed, we only do this once * and reuse for other messages */ if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { - double dummy = 0; double olat = 1.e10; long n = 0; @@ -211,12 +210,12 @@ static int find_global(grib_nearest* nearest, grib_handle* h, if (!self->lons) return GRIB_OUT_OF_MEMORY; - iter = grib_iterator_new(h, 0, &ret); + iter = grib_iterator_new(h, GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret) { grib_context_log(h->context, GRIB_LOG_ERROR, "unable to create iterator"); return ret; } - while (grib_iterator_next(iter, &lat, &lon, &dummy)) { + while (grib_iterator_next(iter, &lat, &lon, NULL)) { if (olat != lat) { self->lats[ilat++] = lat; olat = lat; diff --git a/src/grib_nearest_class_reduced.cc b/src/grib_nearest_class_reduced.cc index 4e034e9b8..6a0777be7 100644 --- a/src/grib_nearest_class_reduced.cc +++ b/src/grib_nearest_class_reduced.cc @@ -215,7 +215,6 @@ static int find_global(grib_nearest* nearest, grib_handle* h, * This is for performance: if the grid has not changed, we only do this once * and reuse for other messages */ if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { - double dummy = 0; double olat = 1.e10; long n = 0; @@ -244,12 +243,12 @@ static int find_global(grib_nearest* nearest, grib_handle* h, if (!self->lons) return GRIB_OUT_OF_MEMORY; - iter = grib_iterator_new(h, 0, &ret); + iter = grib_iterator_new(h, GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_reduced: Unable to create lat/lon iterator"); return ret; } - while (grib_iterator_next(iter, &lat, &lon, &dummy)) { + while (grib_iterator_next(iter, &lat, &lon, NULL)) { if (olat != lat) { self->lats[ilat++] = lat; olat = lat; diff --git a/src/grib_nearest_class_regular.cc b/src/grib_nearest_class_regular.cc index 132da2f5f..25cf38347 100644 --- a/src/grib_nearest_class_regular.cc +++ b/src/grib_nearest_class_regular.cc @@ -253,7 +253,6 @@ static int find(grib_nearest* nearest, grib_handle* h, * This is for performance: if the grid has not changed, we only do this once * and reuse for other messages */ if (!nearest->h || (flags & GRIB_NEAREST_SAME_GRID) == 0) { - double dummy = 0; double olat = 1.e10, olon = 1.e10; int ilat = 0, ilon = 0; long n = 0; @@ -316,12 +315,12 @@ static int find(grib_nearest* nearest, grib_handle* h, if (!self->lons) return GRIB_OUT_OF_MEMORY; - iter = grib_iterator_new(h, 0, &ret); + iter = grib_iterator_new(h, GRIB_GEOITERATOR_NO_VALUES, &ret); if (ret != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_regular: Unable to create lat/lon iterator"); return ret; } - while (grib_iterator_next(iter, &lat, &lon, &dummy)) { + while (grib_iterator_next(iter, &lat, &lon, NULL)) { if (ilat < self->lats_count && olat != lat) { /* Assert(ilat < self->lats_count); */ self->lats[ilat++] = lat; From 24fd0d6441935ca61eb5a9e6303068765e8723cc Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 11 Feb 2023 13:30:42 +0000 Subject: [PATCH 078/212] Testing: -w option --- tests/grib_ls.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index fae7d283a..b9b70afd6 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -147,6 +147,18 @@ grep -q "0 of 38 messages" $temp_ls ${tools_dir}/grib_ls -w units!=K $file > $temp_ls grep -q "30 of 38 messages" $temp_ls +file=mixed.grib # Has 14 messages +${tools_dir}/grib_ls -w packingType=grid_simple,gridType=regular_ll/regular_gg $file > $temp_ls +grep -q "12 of 14 messages" $temp_ls + +${tools_dir}/grib_ls -w packingType=grid_simple/grid_simple_matrix,gridType=regular_ll/regular_gg $file > $temp_ls +grep -q "12 of 14 messages" $temp_ls + +${tools_dir}/grib_ls -w typeOfLevel=surface,centre=7 $file > $temp_ls +grep -q "3 of 14 messages" $temp_ls + +${tools_dir}/grib_ls -w shortName=t/10u,gridType=regular_gg $file > $temp_ls +grep -q "5 of 14 messages" $temp_ls # Clean up rm -f $temp1 $temp2 From 08b6514aa792a7ca3894cffd56c5efd78aafe809 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 11 Feb 2023 14:09:42 +0000 Subject: [PATCH 079/212] Deprecated files --- tools/{ => deprecated}/grib_filter.h | 0 tools/{ => deprecated}/grib_filtery.y | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tools/{ => deprecated}/grib_filter.h (100%) rename tools/{ => deprecated}/grib_filtery.y (100%) diff --git a/tools/grib_filter.h b/tools/deprecated/grib_filter.h similarity index 100% rename from tools/grib_filter.h rename to tools/deprecated/grib_filter.h diff --git a/tools/grib_filtery.y b/tools/deprecated/grib_filtery.y similarity index 100% rename from tools/grib_filtery.y rename to tools/deprecated/grib_filtery.y From bb3dcc0602d6e4446e6921e2d986498390210499 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 11 Feb 2023 15:02:55 +0000 Subject: [PATCH 080/212] Tools: cpplint warning re strtok --- tools/grib_to_netcdf.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/grib_to_netcdf.cc b/tools/grib_to_netcdf.cc index f485286c9..ea0744e5e 100644 --- a/tools/grib_to_netcdf.cc +++ b/tools/grib_to_netcdf.cc @@ -4011,13 +4011,14 @@ int grib_tool_init(grib_runtime_options* options) /* Option -S: Split according to keys */ if (grib_options_on("S:")) { + char* lasts = NULL; list = grib_options_get_option("S:"); - p = strtok(list, ","); + p = strtok_r(list, ",", &lasts); set_value(user_r, "split", p); - p = strtok(NULL, ","); + p = strtok_r(NULL, ",", &lasts); while (p != NULL) { add_value(user_r, "split", p); - p = strtok(NULL, ","); + p = strtok_r(NULL, ",", &lasts); } } else { @@ -4027,13 +4028,14 @@ int grib_tool_init(grib_runtime_options* options) /* Option -I: Ignore keys */ if (grib_options_on("I:")) { + char* lasts = NULL; list = grib_options_get_option("I:"); - p = strtok(list, ","); + p = strtok_r(list, ",", &lasts); set_value(user_r, "ignore", p); - p = strtok(NULL, ","); + p = strtok_r(NULL, ",", &lasts); while (p != NULL) { add_value(user_r, "ignore", p); - p = strtok(NULL, ","); + p = strtok_r(NULL, ",", &lasts); } } else { @@ -4373,7 +4375,6 @@ int grib_no_handle_action(grib_runtime_options* options, int err) #else #include -#include int main(int argc, char** argv) { printf("\n"); From 150c5383be6c41054b883453da8abf3404f6f8d4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 12 Feb 2023 15:23:15 +0000 Subject: [PATCH 081/212] Remove unused variables --- src/grib_ieeefloat.cc | 1 - tests/grib_ecc-1467.cc | 5 ----- 2 files changed, 6 deletions(-) diff --git a/src/grib_ieeefloat.cc b/src/grib_ieeefloat.cc index b8bb60fd4..1f6dbb426 100644 --- a/src/grib_ieeefloat.cc +++ b/src/grib_ieeefloat.cc @@ -391,7 +391,6 @@ int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nva { int err = 0, i = 0, j = 0; unsigned char s[4] = {0,}; - float fval; switch (bytes) { case 4: diff --git a/tests/grib_ecc-1467.cc b/tests/grib_ecc-1467.cc index 887964c8e..6cb063538 100644 --- a/tests/grib_ecc-1467.cc +++ b/tests/grib_ecc-1467.cc @@ -21,12 +21,8 @@ int main(int argc, char** argv) float* fvalues = NULL; /* data values as floats */ double* dvalues = NULL; /* data values as doubles */ size_t values_len = 0; // number of data points - size_t cvalues_len = 0; // coded values excluding missing size_t i = 0; - int mode = 2; // 1=single-precision, 2=double-precision - double daverage = 0; - float faverage = 0; double abs_error = 0; double max_abs_error = 1e-04; double tolerance = 1e-04; @@ -38,7 +34,6 @@ int main(int argc, char** argv) const char* filename = 0; codes_handle* h = NULL; - if (argc != 2) { fprintf(stderr, "usage: %s file\n", argv[0]); return 1; From f516a62f020d604c7c065bdf04880e9e7ac1aed3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 12 Feb 2023 16:16:29 +0000 Subject: [PATCH 082/212] ECC-1528: Tools: Setting -w constraint with count=0 should issue an error --- tests/grib_ls.sh | 39 ++++++++++++++++++++++++++++++--------- tools/grib_tools.cc | 5 +++++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index b9b70afd6..5dd453f75 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -62,8 +62,7 @@ regular_latlon_surface.grib1 regular_latlon_surface.grib2 " -for file in $files -do +for file in $files; do [ -f "$file" ] echo $file >> $tempLog ${tools_dir}/grib_ls -l 40,28 $file | grep index | awk '{print $4;}' >> $tempLog @@ -72,7 +71,8 @@ done diff $tempLog ls.log rm -f $tempLog -# Test for bug GRIB-56 +echo "Test for bug GRIB-56..." +# ------------------------------ ${tools_dir}/grib_set -s typeOfLevel=depthBelowLandLayer,topLevel=missing regular_latlon_surface.grib1 tmp_rlls.grib1 ${tools_dir}/grib_ls -plevels tmp_rlls.grib1 | grep MISSING>/dev/null @@ -80,18 +80,23 @@ ${tools_dir}/grib_set -s typeOfLevel=depthBelowLandLayer,bottomLevel=missing reg ${tools_dir}/grib_ls -plevels tmp_rlls.grib1 | grep MISSING>/dev/null rm -f tmp_rlls.grib1 -# GRIB-305. GRIB edition 1 file with one large message +echo "GRIB-305. GRIB edition 1 file with one large message..." +# ---------------------------------------------------------- if [ -f "sst_globus0083.grib" ]; then - ${tools_dir}/grib_ls sst_globus0083.grib > /dev/null + ${tools_dir}/grib_ls sst_globus0083.grib > /dev/null fi -# GRIB-387 printing key of type byte + +echo "GRIB-387 printing key of type byte..." +# ---------------------------------------------------------- ${tools_dir}/grib_ls -p uuidOfVGrid test_uuid.grib2 > /dev/null type=`${tools_dir}/grib_get -wcount=1 -p typeOfLevel test_uuid.grib2` [ "$type" = "generalVertical" ] -# GRIB-213 nearest with land-sea mask + +echo "GRIB-213 nearest with land-sea mask..." +# ---------------------------------------------------------- temp_ls=temp.grib_ls.grib-213.txt ${tools_dir}/grib_ls -l 85,13,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls grep -q 'Point chosen #3 index=21 .* distance=11\.' $temp_ls @@ -100,7 +105,8 @@ ${tools_dir}/grib_ls -l 53,2,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surfa grep -q 'Point chosen #2 index=749 .* distance=204\.' $temp_ls -# ECC-278: grib_ls -n namespace +echo "ECC-278: grib_ls -n namespace..." +# ---------------------------------------------------------- ${tools_dir}/grib_ls -n geography $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib2.tmpl ${tools_dir}/grib_ls -n data $sample_g1 @@ -118,7 +124,9 @@ diff $temp1 $temp2 # Section pointers grib_check_key_equals $sample_g2 'section0Pointer,section1Pointer,section3Pointer,section4Pointer' '0_16 16_21 37_72 109_34' -# constraints: -w option + +echo "Test constraints: -w option..." +# ---------------------------------------------------------- file=tigge_pf_ecmwf.grib2 # Has 38 messages ${tools_dir}/grib_ls -w count!=1 $file > $temp_ls grep -q "37 of 38 messages" $temp_ls @@ -160,6 +168,19 @@ grep -q "3 of 14 messages" $temp_ls ${tools_dir}/grib_ls -w shortName=t/10u,gridType=regular_gg $file > $temp_ls grep -q "5 of 14 messages" $temp_ls + +# ECC-1528: Try some invalid values for the count constraint +for cval in -1 0 xx; do + set +e + rm -f $temp_ls + ${tools_dir}/grib_ls -w count=$cval $file > $temp_ls 2>&1 + status=$? + set -e + [ $status -ne 0 ] + grep -q "Invalid value for key 'count'" $temp_ls +done + + # Clean up rm -f $temp1 $temp2 rm -f $temp_ls diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index ffb33b4b8..83d5c4b30 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -808,6 +808,11 @@ static int to_skip(grib_handle* h, grib_values* v, int* err) size_t len = MAX_STRING_LEN; *err = 0; + if (strcmp(v->name, "count")==0 && v->long_value < 1) { + fprintf(dump_file, "ERROR: Invalid value for key '%s' (must be an integer greater than 0)\n", v->name); + exit(1); + } + switch (v->type) { case GRIB_TYPE_STRING: *err = grib_get_string(h, v->name, value, &len); From 71e9f3704036c30bfc8ffaba142719c0c9d10999 Mon Sep 17 00:00:00 2001 From: Sebastien Villaume Date: Mon, 13 Feb 2023 10:10:09 +0000 Subject: [PATCH 083/212] adding functionality to have expver other than prod/test --- definitions/grib2/crraLocalVersion.table | 1 + definitions/grib2/local.crra.2.def | 7 +++++++ definitions/grib2/products_10.def | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 definitions/grib2/local.crra.2.def diff --git a/definitions/grib2/crraLocalVersion.table b/definitions/grib2/crraLocalVersion.table index 3b7d11367..b84a43579 100644 --- a/definitions/grib2/crraLocalVersion.table +++ b/definitions/grib2/crraLocalVersion.table @@ -1 +1,2 @@ 1 CRRA Copernicus regional reanalysis +2 CRRA Copernicus regional reanalysis with expver diff --git a/definitions/grib2/local.crra.2.def b/definitions/grib2/local.crra.2.def new file mode 100644 index 000000000..bb3c1b8ae --- /dev/null +++ b/definitions/grib2/local.crra.2.def @@ -0,0 +1,7 @@ +# CARRA/CERRA local + +codetable[2] suiteName "grib2/crra_suiteName.table" : dump; +alias crraSuiteID = suiteName; + +ksec1expver[4] experimentVersionNumber = "0002" : dump; +alias marsExpver = experimentVersionNumber ; diff --git a/definitions/grib2/products_10.def b/definitions/grib2/products_10.def index bafd04a6f..112d496c9 100644 --- a/definitions/grib2/products_10.def +++ b/definitions/grib2/products_10.def @@ -1,5 +1,7 @@ # (C) Copyright 2005- ECMWF. # Copernicus regional reanalysis (CARRA/CERRA) +if (!defined(marsExpver)) { constant marsExpver = 'prod'; +} include "grib2/products_crra.def" From a6c7d37f86ca1a6f4e186c3c679a0f752599d580 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Feb 2023 10:36:47 +0000 Subject: [PATCH 084/212] Clang-format --- .clang-format | 2 + src/eccodes.h | 1190 +++++++++++++++++++------------------- src/eccodes_prototypes.h | 22 +- src/grib_api.h | 1138 ++++++++++++++++++------------------ 4 files changed, 1177 insertions(+), 1175 deletions(-) diff --git a/.clang-format b/.clang-format index 6570f09ec..1d0bd7ff4 100644 --- a/.clang-format +++ b/.clang-format @@ -4,6 +4,7 @@ AccessModifierOffset: -4 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: true AlignConsecutiveDeclarations: false +AlignConsecutiveMacros: true AlignEscapedNewlines: Left AlignOperands: true AlignTrailingComments: true @@ -66,6 +67,7 @@ IncludeCategories: Priority: 3 IncludeIsMainRegex: '([-_](test|unittest))?$' IndentCaseLabels: true +IndentPPDirectives: BeforeHash IndentWidth: 4 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave diff --git a/src/eccodes.h b/src/eccodes.h index 6eff46f6f..36e70e0e0 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -197,7 +197,7 @@ The codes_index is the structure giving indexed access to messages in a file. /*! index structure to access messages in a file. * \ingroup codes_index * \struct codes_index -*/ + */ typedef struct grib_index codes_index; /** @@ -346,74 +346,74 @@ The codes_handle is the structure giving access to parsed message values by keys */ /*! @{*/ /** -* Counts the messages contained in a file resource. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param f : the file resource -* @param n : the number of messages in the file -* @return 0 if OK, integer value on error -*/ + * Counts the messages contained in a file resource. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param f : the file resource + * @param n : the number of messages in the file + * @return 0 if OK, integer value on error + */ int codes_count_in_file(codes_context* c, FILE* f, int* n); /** -* Counts the messages contained in a file. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param filename : the path to the file -* @param n : the number of messages in the file -* @return 0 if OK, integer value on error -*/ + * Counts the messages contained in a file. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param filename : the path to the file + * @param n : the number of messages in the file + * @return 0 if OK, integer value on error + */ int codes_count_in_filename(codes_context* c, const char* filename, int* n); /** -* Create a handle from a file resource. -* The file is read until a message is found. The message is then copied. -* Remember always to delete the handle when it is not needed anymore to avoid -* memory leaks. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param f : the file resource -* @param product : the kind of product e.g. PRODUCT_GRIB, PRODUCT_BUFR -* @param error : error code set if the returned handle is NULL and the end of file is not reached -* @return the new handle, NULL if the resource is invalid or a problem is encountered -*/ + * Create a handle from a file resource. + * The file is read until a message is found. The message is then copied. + * Remember always to delete the handle when it is not needed anymore to avoid + * memory leaks. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param f : the file resource + * @param product : the kind of product e.g. PRODUCT_GRIB, PRODUCT_BUFR + * @param error : error code set if the returned handle is NULL and the end of file is not reached + * @return the new handle, NULL if the resource is invalid or a problem is encountered + */ codes_handle* codes_handle_new_from_file(codes_context* c, FILE* f, ProductKind product, int* error); /** -* Create a GRIB handle from a file resource. -* The file is read until a GRIB message is found. The message is then copied. -* Remember always to delete the handle when it is not needed anymore to avoid -* memory leaks. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param f : the file resource -* @param error : error code set if the returned handle is NULL and the end of file is not reached -* @return the new handle, NULL if the resource is invalid or a problem is encountered -*/ + * Create a GRIB handle from a file resource. + * The file is read until a GRIB message is found. The message is then copied. + * Remember always to delete the handle when it is not needed anymore to avoid + * memory leaks. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param f : the file resource + * @param error : error code set if the returned handle is NULL and the end of file is not reached + * @return the new handle, NULL if the resource is invalid or a problem is encountered + */ codes_handle* codes_grib_handle_new_from_file(codes_context* c, FILE* f, int* error); /** -* Create a BUFR handle from a file resource. -* The file is read until a BUFR message is found. The message is then copied. -* Remember always to delete the handle when it is not needed anymore to avoid -* memory leaks. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param f : the file resource -* @param error : error code set if the returned handle is NULL and the end of file is not reached -* @return the new handle, NULL if the resource is invalid or a problem is encountered -*/ + * Create a BUFR handle from a file resource. + * The file is read until a BUFR message is found. The message is then copied. + * Remember always to delete the handle when it is not needed anymore to avoid + * memory leaks. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param f : the file resource + * @param error : error code set if the returned handle is NULL and the end of file is not reached + * @return the new handle, NULL if the resource is invalid or a problem is encountered + */ codes_handle* codes_bufr_handle_new_from_file(codes_context* c, FILE* f, int* error); /** -* Write a coded message to a file. -* -* @param h : codes_handle to be written -* @param file : name of the output file -* @param mode : mode -* @return 0 if OK, integer value on error -*/ + * Write a coded message to a file. + * + * @param h : codes_handle to be written + * @param file : name of the output file + * @param mode : mode + * @return 0 if OK, integer value on error + */ int codes_write_message(const codes_handle* h, const char* file, const char* mode); codes_handle* codes_grib_util_sections_copy(codes_handle* hfrom, codes_handle* hto, int what, int* err); @@ -421,38 +421,38 @@ codes_string_list* codes_grib_util_get_param_id(const char* mars_param); codes_string_list* codes_grib_util_get_mars_param(const char* param_id); /** -* Create a handle from a user message in memory. The message will not be freed at the end. -* The message will be copied as soon as a modification is needed. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param data : the actual message -* @param data_len : the length of the message in number of bytes -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Create a handle from a user message in memory. The message will not be freed at the end. + * The message will be copied as soon as a modification is needed. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param data : the actual message + * @param data_len : the length of the message in number of bytes + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ codes_handle* codes_handle_new_from_message(codes_context* c, const void* data, size_t data_len); /** -* Create a handle from a user message in memory. The message will not be freed at the end. -* The message will be copied as soon as a modification is needed. -* This function works also with GRIB multi-field messages. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param data : the actual message -* @param data_len : the length of the message in number of bytes -* @param error : error code -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Create a handle from a user message in memory. The message will not be freed at the end. + * The message will be copied as soon as a modification is needed. + * This function works also with GRIB multi-field messages. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param data : the actual message + * @param data_len : the length of the message in number of bytes + * @param error : error code + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ codes_handle* codes_grib_handle_new_from_multi_message(codes_context* c, void** data, size_t* data_len, int* error); /** -* Create a handle from a user message. The message is copied and will be freed with the handle -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param data : the actual message -* @param data_len : the length of the message in number of bytes -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Create a handle from a user message. The message is copied and will be freed with the handle + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param data : the actual message + * @param data_len : the length of the message in number of bytes + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ codes_handle* codes_handle_new_from_message_copy(codes_context* c, const void* data, size_t data_len); @@ -489,20 +489,20 @@ codes_handle* codes_handle_new_from_samples(codes_context* c, const char* sample /** -* Clone an existing handle using the context of the original handle, -* The message is copied and reparsed -* -* @param h : The handle to be cloned -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Clone an existing handle using the context of the original handle, + * The message is copied and reparsed + * + * @param h : The handle to be cloned + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ codes_handle* codes_handle_clone(const codes_handle* h); /** -* Frees a handle, also frees the message if it is not a user message -* @see codes_handle_new_from_message -* @param h : The handle to be deleted -* @return 0 if OK, integer value on error -*/ + * Frees a handle, also frees the message if it is not a user message + * @see codes_handle_new_from_message + * @param h : The handle to be deleted + * @return 0 if OK, integer value on error + */ int codes_handle_delete(codes_handle* h); /** @@ -555,25 +555,25 @@ int codes_grib_multi_handle_write(codes_multi_handle* mh, FILE* f); /*! \defgroup handling_coded_messages Handling coded messages */ /*! @{ */ /** -* getting the message attached to a handle -* -* @param h : the handle to which the buffer should be gathered -* @param message : the pointer to be set to the handle's data -* @param message_length : On exit, the message size in number of bytes -* @return 0 if OK, integer value on error -*/ + * getting the message attached to a handle + * + * @param h : the handle to which the buffer should be gathered + * @param message : the pointer to be set to the handle's data + * @param message_length : On exit, the message size in number of bytes + * @return 0 if OK, integer value on error + */ int codes_get_message(const codes_handle* h, const void** message, size_t* message_length); /** -* getting a copy of the message attached to a handle -* -* @param h : the handle to which the buffer should be returned -* @param message : the pointer to the data buffer to be filled -* @param message_length : On entry, the size in number of bytes of the allocated empty message. -* On exit, the actual message length in number of bytes -* @return 0 if OK, integer value on error -*/ + * getting a copy of the message attached to a handle + * + * @param h : the handle to which the buffer should be returned + * @param message : the pointer to the data buffer to be filled + * @param message_length : On entry, the size in number of bytes of the allocated empty message. + * On exit, the actual message length in number of bytes + * @return 0 if OK, integer value on error + */ int codes_get_message_copy(const codes_handle* h, void* message, size_t* message_length); /*! @} */ @@ -581,140 +581,140 @@ int codes_get_message_copy(const codes_handle* h, void* message, size_t* message /*! @{ */ /*! -* \brief Create a new geoiterator from a GRIB handle, using current geometry and values. -* -* \param h : the handle from which the geoiterator will be created -* \param flags : flags for future use. -* \param error : error code -* \return the new geoiterator, NULL if no geoiterator can be created -*/ + * \brief Create a new geoiterator from a GRIB handle, using current geometry and values. + * + * \param h : the handle from which the geoiterator will be created + * \param flags : flags for future use. + * \param error : error code + * \return the new geoiterator, NULL if no geoiterator can be created + */ codes_iterator* codes_grib_iterator_new(const codes_handle* h, unsigned long flags, int* error); /** -* Get latitude/longitude and data values for a GRIB message. -* The latitudes, longitudes and values arrays must be properly allocated by the caller. -* Their required dimension can be obtained by getting the value of the integer key "numberOfPoints". -* -* @param h : handle from which geography and data values are taken -* @param lats : returned array of latitudes -* @param lons : returned array of longitudes -* @param values : returned array of data values -* @return 0 if OK, integer value on error -*/ + * Get latitude/longitude and data values for a GRIB message. + * The latitudes, longitudes and values arrays must be properly allocated by the caller. + * Their required dimension can be obtained by getting the value of the integer key "numberOfPoints". + * + * @param h : handle from which geography and data values are taken + * @param lats : returned array of latitudes + * @param lons : returned array of longitudes + * @param values : returned array of data values + * @return 0 if OK, integer value on error + */ int codes_grib_get_data(const codes_handle* h, double* lats, double* lons, double* values); /** -* Get the next value from a geoiterator. -* -* @param i : the geoiterator -* @param lat : on output latitude in degree -* @param lon : on output longitude in degree -* @param value : on output value of the point -* @return positive value if successful, 0 if no more data are available -*/ + * Get the next value from a geoiterator. + * + * @param i : the geoiterator + * @param lat : on output latitude in degree + * @param lon : on output longitude in degree + * @param value : on output value of the point + * @return positive value if successful, 0 if no more data are available + */ int codes_grib_iterator_next(codes_iterator* i, double* lat, double* lon, double* value); /** -* Get the previous value from a geoiterator. -* -* @param i : the geoiterator -* @param lat : on output latitude in degree -* @param lon : on output longitude in degree -* @param value : on output value of the point* -* @return positive value if successful, 0 if no more data are available -*/ + * Get the previous value from a geoiterator. + * + * @param i : the geoiterator + * @param lat : on output latitude in degree + * @param lon : on output longitude in degree + * @param value : on output value of the point* + * @return positive value if successful, 0 if no more data are available + */ int codes_grib_iterator_previous(codes_iterator* i, double* lat, double* lon, double* value); /** -* Test procedure for values in a geoiterator. -* -* @param i : the geoiterator -* @return boolean, 1 if the iterator still nave next values, 0 otherwise -*/ + * Test procedure for values in a geoiterator. + * + * @param i : the geoiterator + * @return boolean, 1 if the iterator still nave next values, 0 otherwise + */ int codes_grib_iterator_has_next(codes_iterator* i); /** -* Test procedure for values in a geoiterator. -* -* @param i : the geoiterator -* @return 0 if OK, integer value on error -*/ + * Test procedure for values in a geoiterator. + * + * @param i : the geoiterator + * @return 0 if OK, integer value on error + */ int codes_grib_iterator_reset(codes_iterator* i); /** -* Frees the geoiterator from memory. -* -* @param i : the geoiterator -* @return 0 if OK, integer value on error -*/ + * Frees the geoiterator from memory. + * + * @param i : the geoiterator + * @return 0 if OK, integer value on error + */ int codes_grib_iterator_delete(codes_iterator* i); /*! -* \brief Create a new nearest neighbour object from a handle, using current geometry. -* -* \param h : the handle from which the nearest object will be created -* \param error : error code -* \return the new nearest, NULL if no nearest can be created -*/ + * \brief Create a new nearest neighbour object from a handle, using current geometry. + * + * \param h : the handle from which the nearest object will be created + * \param error : error code + * \return the new nearest, NULL if no nearest can be created + */ codes_nearest* codes_grib_nearest_new(const codes_handle* h, int* error); /** -* Find the 4 nearest points of a latitude longitude point. -* The flags are provided to speed up the process of searching. If you are -* sure that the point you are asking for is not changing from a call -* to another you can use CODES_NEAREST_SAME_POINT. The same is valid for -* the grid. Flags can be used together doing a bitwise OR. -* The distances are given in kilometres. -* -* @param nearest : nearest structure -* @param h : handle from which geography and data values are taken -* @param inlat : latitude of the point to search for -* @param inlon : longitude of the point to search for -* @param flags : CODES_NEAREST_SAME_POINT, CODES_NEAREST_SAME_GRID -* @param outlats : returned array of latitudes of the nearest points -* @param outlons : returned array of longitudes of the nearest points -* @param values : returned array of data values of the nearest points -* @param distances : returned array of distances from the nearest points -* @param indexes : returned array of indexes of the nearest points -* @param len : size of the arrays -* @return 0 if OK, integer value on error -*/ + * Find the 4 nearest points of a latitude longitude point. + * The flags are provided to speed up the process of searching. If you are + * sure that the point you are asking for is not changing from a call + * to another you can use CODES_NEAREST_SAME_POINT. The same is valid for + * the grid. Flags can be used together doing a bitwise OR. + * The distances are given in kilometres. + * + * @param nearest : nearest structure + * @param h : handle from which geography and data values are taken + * @param inlat : latitude of the point to search for + * @param inlon : longitude of the point to search for + * @param flags : CODES_NEAREST_SAME_POINT, CODES_NEAREST_SAME_GRID + * @param outlats : returned array of latitudes of the nearest points + * @param outlons : returned array of longitudes of the nearest points + * @param values : returned array of data values of the nearest points + * @param distances : returned array of distances from the nearest points + * @param indexes : returned array of indexes of the nearest points + * @param len : size of the arrays + * @return 0 if OK, integer value on error + */ int codes_grib_nearest_find(codes_nearest* nearest, const codes_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); /** -* Frees a nearest object from memory -* -* @param nearest : the nearest -* @return 0 if OK, integer value on error -*/ + * Frees a nearest object from memory + * + * @param nearest : the nearest + * @return 0 if OK, integer value on error + */ int codes_grib_nearest_delete(codes_nearest* nearest); /** -* Find the nearest point of a set of points whose latitudes and longitudes -* are given in the inlats, inlons arrays respectively. -* If the flag is_lsm is 1 the nearest land point is returned and the -* GRIB passed as handle (h) is considered a land sea mask. -* The land nearest point is the nearest point with land sea mask value>=0.5. -* If no nearest land points are found the nearest value is returned. -* If the flag is_lsm is 0 the nearest point is returned. -* values, distances, indexes (in the "values" array) for the nearest points (ilons,ilats) -* are returned. -* The distances are given in kilometres. -* -* @param h : handle from which geography and data values are taken -* @param is_lsm : lsm flag (1-> nearest land, 0-> nearest) -* @param inlats : latitudes of the points to search for -* @param inlons : longitudes of the points to search for -* @param npoints : number of points (size of the inlats,inlons,outlats,outlons,values,distances,indexes arrays) -* @param outlats : returned array of latitudes of the nearest points -* @param outlons : returned array of longitudes of the nearest points -* @param values : returned array of data values of the nearest points -* @param distances : returned array of distances from the nearest points -* @param indexes : returned array of indexes of the nearest points -* @return 0 if OK, integer value on error -*/ + * Find the nearest point of a set of points whose latitudes and longitudes + * are given in the inlats, inlons arrays respectively. + * If the flag is_lsm is 1 the nearest land point is returned and the + * GRIB passed as handle (h) is considered a land sea mask. + * The land nearest point is the nearest point with land sea mask value>=0.5. + * If no nearest land points are found the nearest value is returned. + * If the flag is_lsm is 0 the nearest point is returned. + * values, distances, indexes (in the "values" array) for the nearest points (ilons,ilats) + * are returned. + * The distances are given in kilometres. + * + * @param h : handle from which geography and data values are taken + * @param is_lsm : lsm flag (1-> nearest land, 0-> nearest) + * @param inlats : latitudes of the points to search for + * @param inlons : longitudes of the points to search for + * @param npoints : number of points (size of the inlats,inlons,outlats,outlons,values,distances,indexes arrays) + * @param outlats : returned array of latitudes of the nearest points + * @param outlons : returned array of longitudes of the nearest points + * @param values : returned array of data values of the nearest points + * @param distances : returned array of distances from the nearest points + * @param indexes : returned array of indexes of the nearest points + * @return 0 if OK, integer value on error + */ int codes_grib_nearest_find_multiple(const codes_handle* h, int is_lsm, const double* inlats, const double* inlons, long npoints, double* outlats, double* outlons, @@ -725,262 +725,262 @@ int codes_grib_nearest_find_multiple(const codes_handle* h, int is_lsm, /*! \defgroup get_set Accessing header and data values */ /*! @{ */ /** -* Get the number offset of a key, in a message if several keys of the same name -* are present, the offset of the last one is returned -* -* @param h : the handle to get the offset from -* @param key : the key to be searched -* @param offset : the address of a size_t where the offset will be set -* @return 0 if OK, integer value on error -*/ + * Get the number offset of a key, in a message if several keys of the same name + * are present, the offset of the last one is returned + * + * @param h : the handle to get the offset from + * @param key : the key to be searched + * @param offset : the address of a size_t where the offset will be set + * @return 0 if OK, integer value on error + */ int codes_get_offset(const codes_handle* h, const char* key, size_t* offset); /** -* Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned -* -* @param h : the handle to get the offset from -* @param key : the key to be searched -* @param size : the address of a size_t where the size will be set -* @return 0 if OK, integer value on error -*/ + * Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned + * + * @param h : the handle to get the offset from + * @param key : the key to be searched + * @param size : the address of a size_t where the size will be set + * @return 0 if OK, integer value on error + */ int codes_get_size(const codes_handle* h, const char* key, size_t* size); /** -* Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned -* -* @param h : the handle to get the offset from -* @param key : the key to be searched -* @param length : the address of a size_t where the length will be set -* @return 0 if OK, integer value on error -*/ + * Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned + * + * @param h : the handle to get the offset from + * @param key : the key to be searched + * @param length : the address of a size_t where the length will be set + * @return 0 if OK, integer value on error + */ int codes_get_length(const codes_handle* h, const char* key, size_t* length); /** -* Get a long value from a key, if several keys of the same name are present, the last one is returned -* @see codes_set_long -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param value : the address of a long where the data will be retrieved -* @return 0 if OK, integer value on error -*/ + * Get a long value from a key, if several keys of the same name are present, the last one is returned + * @see codes_set_long + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param value : the address of a long where the data will be retrieved + * @return 0 if OK, integer value on error + */ int codes_get_long(const codes_handle* h, const char* key, long* value); /** -* Get a double value from a key, if several keys of the same name are present, the last one is returned -* @see codes_set_double -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param value : the address of a double where the data will be retrieved -* @return 0 if OK, integer value on error -*/ + * Get a double value from a key, if several keys of the same name are present, the last one is returned + * @see codes_set_double + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param value : the address of a double where the data will be retrieved + * @return 0 if OK, integer value on error + */ int codes_get_double(const codes_handle* h, const char* key, double* value); /** -* Get as double the i-th element of the "key" array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param i : zero-based index -* @param value : the address of a double where the data will be retrieved -* @return 0 if OK, integer value on error -*/ + * Get as double the i-th element of the "key" array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param i : zero-based index + * @param value : the address of a double where the data will be retrieved + * @return 0 if OK, integer value on error + */ int codes_get_double_element(const codes_handle* h, const char* key, int i, double* value); /** -* Get as double array the elements of the "key" array whose indexes are listed in the input array "index_array" -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param index_array : zero-based array of indexes -* @param size : size of the index_array and value arrays -* @param value : the double array for the data values -* @return 0 if OK, integer value on error -*/ + * Get as double array the elements of the "key" array whose indexes are listed in the input array "index_array" + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param index_array : zero-based array of indexes + * @param size : size of the index_array and value arrays + * @param value : the double array for the data values + * @return 0 if OK, integer value on error + */ int codes_get_double_elements(const codes_handle* h, const char* key, const int* index_array, long size, double* value); /** -* Get a string value from a key, if several keys of the same name are present, the last one is returned -* @see codes_set_string -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param mesg : the address of a string where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output -* @return 0 if OK, integer value on error -*/ + * Get a string value from a key, if several keys of the same name are present, the last one is returned + * @see codes_set_string + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param mesg : the address of a string where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output + * @return 0 if OK, integer value on error + */ int codes_get_string(const codes_handle* h, const char* key, char* mesg, size_t* length); /** -* Get string array values from a key. If several keys of the same name are present, the last one is returned -* @see codes_set_string_array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param vals : the address of a string array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output -* @return 0 if OK, integer value on error -*/ + * Get string array values from a key. If several keys of the same name are present, the last one is returned + * @see codes_set_string_array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param vals : the address of a string array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output + * @return 0 if OK, integer value on error + */ int codes_get_string_array(const codes_handle* h, const char* key, char** vals, size_t* length); /** -* Get raw bytes values from a key. If several keys of the same name are present, the last one is returned -* @see codes_set_bytes -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param bytes : the address of a byte array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output -* @return 0 if OK, integer value on error -*/ + * Get raw bytes values from a key. If several keys of the same name are present, the last one is returned + * @see codes_set_bytes + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param bytes : the address of a byte array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output + * @return 0 if OK, integer value on error + */ int codes_get_bytes(const codes_handle* h, const char* key, unsigned char* bytes, size_t* length); /** -* Get double array values from a key. If several keys of the same name are present, the last one is returned -* @see codes_set_double_array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param vals : the address of a double array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output -* @return 0 if OK, integer value on error -*/ + * Get double array values from a key. If several keys of the same name are present, the last one is returned + * @see codes_set_double_array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param vals : the address of a double array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output + * @return 0 if OK, integer value on error + */ int codes_get_double_array(const codes_handle* h, const char* key, double* vals, size_t* length); /** -* Get long array values from a key. If several keys of the same name are present, the last one is returned -* @see codes_set_long_array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param vals : the address of a long array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output -* @return 0 if OK, integer value on error -*/ + * Get long array values from a key. If several keys of the same name are present, the last one is returned + * @see codes_set_long_array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param vals : the address of a long array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output + * @return 0 if OK, integer value on error + */ int codes_get_long_array(const codes_handle* h, const char* key, long* vals, size_t* length); /* setting data */ /** -* Copy the keys belonging to a given namespace from a source handle to a destination handle -* -* -* @param dest : destination handle -* @param name : namespace -* @param src : source handle -* @return 0 if OK, integer value on error -*/ + * Copy the keys belonging to a given namespace from a source handle to a destination handle + * + * + * @param dest : destination handle + * @param name : namespace + * @param src : source handle + * @return 0 if OK, integer value on error + */ int codes_copy_namespace(codes_handle* dest, const char* name, codes_handle* src); /** -* Set a long value from a key. If several keys of the same name are present, the last one is set -* @see codes_get_long -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param val : a long where the data will be read -* @return 0 if OK, integer value on error -*/ + * Set a long value from a key. If several keys of the same name are present, the last one is set + * @see codes_get_long + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param val : a long where the data will be read + * @return 0 if OK, integer value on error + */ int codes_set_long(codes_handle* h, const char* key, long val); /** -* Set a double value from a key. If several keys of the same name are present, the last one is set -* @see codes_get_double -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param val : a double where the data will be read -* @return 0 if OK, integer value on error -*/ + * Set a double value from a key. If several keys of the same name are present, the last one is set + * @see codes_get_double + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param val : a double where the data will be read + * @return 0 if OK, integer value on error + */ int codes_set_double(codes_handle* h, const char* key, double val); /** -* Set a string value from a key. If several keys of the same name are present, the last one is set -* @see codes_get_string -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param mesg : the address of a string where the data will be read -* @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output -* @return 0 if OK, integer value on error -*/ + * Set a string value from a key. If several keys of the same name are present, the last one is set + * @see codes_get_string + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param mesg : the address of a string where the data will be read + * @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output + * @return 0 if OK, integer value on error + */ int codes_set_string(codes_handle* h, const char* key, const char* mesg, size_t* length); /** -* Set a bytes array from a key. If several keys of the same name are present, the last one is set -* @see codes_get_bytes -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param bytes : the address of a byte array where the data will be read -* @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output -* @return 0 if OK, integer value on error -*/ + * Set a bytes array from a key. If several keys of the same name are present, the last one is set + * @see codes_get_bytes + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param bytes : the address of a byte array where the data will be read + * @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output + * @return 0 if OK, integer value on error + */ int codes_set_bytes(codes_handle* h, const char* key, const unsigned char* bytes, size_t* length); /** -* Set a double array from a key. If several keys of the same name are present, the last one is set -* @see codes_get_double_array -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param vals : the address of a double array where the data will be read -* @param length : a size_t that contains the length of the byte array on input -* @return 0 if OK, integer value on error -*/ + * Set a double array from a key. If several keys of the same name are present, the last one is set + * @see codes_get_double_array + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param vals : the address of a double array where the data will be read + * @param length : a size_t that contains the length of the byte array on input + * @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); /** -* Same as codes_set_double_array but allows setting of READ-ONLY keys like codedValues. -* Use with great caution!! -*/ + * 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); /** -* Set a long array from a key. If several keys of the same name are present, the last one is set -* @see codes_get_long_array -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param vals : the address of a long array where the data will be read -* @param length : a size_t that contains the length of the long array on input -* @return 0 if OK, integer value on error -*/ + * Set a long array from a key. If several keys of the same name are present, the last one is set + * @see codes_get_long_array + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param vals : the address of a long array where the data will be read + * @param length : a size_t that contains the length of the long array on input + * @return 0 if OK, integer value on error + */ int codes_set_long_array(codes_handle* h, const char* key, const long* vals, size_t length); /** -* Set a string array from a key. If several keys of the same name are present, the last one is set -* @see codes_get_long_array -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param vals : the address of a string array where the data will be read -* @param length : a size_t that contains the length of the array on input -* @return 0 if OK, integer value on error -*/ + * Set a string array from a key. If several keys of the same name are present, the last one is set + * @see codes_get_long_array + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param vals : the address of a string array where the data will be read + * @param length : a size_t that contains the length of the array on input + * @return 0 if OK, integer value on error + */ int codes_set_string_array(codes_handle* h, const char* key, const char** vals, size_t length); /*! @} */ /** -* Print all keys, with the context print procedure and dump mode to a resource -* -* @param h : the handle to be printed -* @param out : output file handle -* @param mode : Examples of available dump modes: debug wmo -* @param option_flags : all the CODES_DUMP_FLAG_x flags can be used -* @param arg : used to provide a format to output data (experimental) -*/ + * Print all keys, with the context print procedure and dump mode to a resource + * + * @param h : the handle to be printed + * @param out : output file handle + * @param mode : Examples of available dump modes: debug wmo + * @param option_flags : all the CODES_DUMP_FLAG_x flags can be used + * @param arg : used to provide a format to output data (experimental) + */ void codes_dump_content(const codes_handle* h, FILE* out, const char* mode, unsigned long option_flags, void* arg); /** -* Print all keys from the parsed definition files available in a context -* -* @param f : the File used to print the keys on -* @param c : the context that contains the cached definition files to be printed -*/ + * Print all keys from the parsed definition files available in a context + * + * @param f : the File used to print the keys on + * @param c : the context that contains the cached definition files to be printed + */ void codes_dump_action_tree(codes_context* c, FILE* f); /*! \defgroup context The context object @@ -991,79 +991,79 @@ void codes_dump_action_tree(codes_context* c, FILE* f); /*! @{ */ /** -* ecCodes free procedure, format of a procedure referenced in the context that is used to free memory -* -* @param c : the context where the memory freeing will apply -* @param data : pointer to the data to be freed -* must match @see codes_malloc_proc -*/ + * ecCodes free procedure, format of a procedure referenced in the context that is used to free memory + * + * @param c : the context where the memory freeing will apply + * @param data : pointer to the data to be freed + * must match @see codes_malloc_proc + */ typedef void (*codes_free_proc)(const codes_context* c, void* data); /** -* ecCodes malloc procedure, format of a procedure referenced in the context that is used to allocate memory -* @param c : the context where the memory allocation will apply -* @param length : length to be allocated in number of bytes -* @return a pointer to the allocated memory, NULL if no memory can be allocated -* must match @see codes_free_proc -*/ + * ecCodes malloc procedure, format of a procedure referenced in the context that is used to allocate memory + * @param c : the context where the memory allocation will apply + * @param length : length to be allocated in number of bytes + * @return a pointer to the allocated memory, NULL if no memory can be allocated + * must match @see codes_free_proc + */ typedef void* (*codes_malloc_proc)(const codes_context* c, size_t length); /** -* ecCodes realloc procedure, format of a procedure referenced in the context that is used to reallocate memory -* @param c : the context where the memory allocation will apply -* @param data : pointer to the data to be reallocated -* @param length : length to be allocated in number of bytes -* @return a pointer to the allocated memory -*/ + * ecCodes realloc procedure, format of a procedure referenced in the context that is used to reallocate memory + * @param c : the context where the memory allocation will apply + * @param data : pointer to the data to be reallocated + * @param length : length to be allocated in number of bytes + * @return a pointer to the allocated memory + */ typedef void* (*codes_realloc_proc)(const codes_context* c, void* data, size_t length); /** -* ecCodes log procedure, format of a procedure referenced in the context that is used to log internal messages -* -* @param c : the context where the logging will apply -* @param level : the log level, as defined in log modes -* @param mesg : the message to be logged -*/ + * ecCodes log procedure, format of a procedure referenced in the context that is used to log internal messages + * + * @param c : the context where the logging will apply + * @param level : the log level, as defined in log modes + * @param mesg : the message to be logged + */ typedef void (*codes_log_proc)(const codes_context* c, int level, const char* mesg); /** -* ecCodes print procedure, format of a procedure referenced in the context that is used to print external messages -* -* @param c : the context where the logging will apply -* @param descriptor : the structure to be printed on, must match the implementation -* @param mesg : the message to be printed -*/ + * ecCodes print procedure, format of a procedure referenced in the context that is used to print external messages + * + * @param c : the context where the logging will apply + * @param descriptor : the structure to be printed on, must match the implementation + * @param mesg : the message to be printed + */ typedef void (*codes_print_proc)(const codes_context* c, void* descriptor, const char* mesg); /** -* ecCodes data read procedure, format of a procedure referenced in the context that is used to read from a stream in a resource -* -* @param c : the context where the read will apply -* @param ptr : the resource -* @param size : size to read -* @param stream : the stream -* @return size read -*/ + * ecCodes data read procedure, format of a procedure referenced in the context that is used to read from a stream in a resource + * + * @param c : the context where the read will apply + * @param ptr : the resource + * @param size : size to read + * @param stream : the stream + * @return size read + */ typedef size_t (*codes_data_read_proc)(const codes_context* c, void* ptr, size_t size, void* stream); /** -* ecCodes data write procedure, format of a procedure referenced in the context that is used to write to a stream from a resource -* -* @param c : the context where the write will apply -* @param ptr : the resource -* @param size : size to read -* @param stream : the stream -* @return size written -*/ + * ecCodes data write procedure, format of a procedure referenced in the context that is used to write to a stream from a resource + * + * @param c : the context where the write will apply + * @param ptr : the resource + * @param size : size to read + * @param stream : the stream + * @return size written + */ typedef size_t (*codes_data_write_proc)(const codes_context* c, const void* ptr, size_t size, void* stream); /** -* ecCodes data tell procedure, format of a procedure referenced in the context that is used to tell the current position in a stream -* -* @param c : the context where the tell will apply -* @param stream : the stream -* @return the position in the stream -*/ + * ecCodes data tell procedure, format of a procedure referenced in the context that is used to tell the current position in a stream + * + * @param c : the context where the tell will apply + * @param stream : the stream + * @return the position in the stream + */ typedef off_t (*codes_data_tell_proc)(const codes_context* c, void* stream); /** @@ -1079,65 +1079,65 @@ typedef off_t (*codes_data_tell_proc)(const codes_context* c, void* stream); typedef off_t (*codes_data_seek_proc)(const codes_context* c, off_t offset, int whence, void* stream); /** -* ecCodes data eof procedure, format of a procedure referenced in the context that is used to test end of file -* -* @param c : the context where the tell will apply -* @param stream : the stream -* @return the position in the stream -*/ + * ecCodes data eof procedure, format of a procedure referenced in the context that is used to test end of file + * + * @param c : the context where the tell will apply + * @param stream : the stream + * @return the position in the stream + */ typedef int (*codes_data_eof_proc)(const codes_context* c, void* stream); /** -* Get the static default context -* -* @return the default context, NULL it the context is not available -*/ + * Get the static default context + * + * @return the default context, NULL it the context is not available + */ codes_context* codes_context_get_default(void); /** -* Frees the cached definition files of the context -* -* @param c : the context to be deleted -*/ + * Frees the cached definition files of the context + * + * @param c : the context to be deleted + */ void codes_context_delete(codes_context* c); /** -* Set the GTS header mode on. -* The GTS headers will be preserved. -* -* @param c : the context -*/ + * Set the GTS header mode on. + * The GTS headers will be preserved. + * + * @param c : the context + */ void codes_gts_header_on(codes_context* c); /** -* Set the GTS header mode off. -* The GTS headers will be deleted. -* -* @param c : the context -*/ + * Set the GTS header mode off. + * The GTS headers will be deleted. + * + * @param c : the context + */ void codes_gts_header_off(codes_context* c); /** -* Set the GRIBEX mode on. -* GRIB files will be compatible with GRIBEX. -* -* @param c : the context -*/ + * Set the GRIBEX mode on. + * GRIB files will be compatible with GRIBEX. + * + * @param c : the context + */ void codes_gribex_mode_on(codes_context* c); /** -* Get the GRIBEX mode. -* -* @param c : the context -*/ + * Get the GRIBEX mode. + * + * @param c : the context + */ int codes_get_gribex_mode(codes_context* c); /** -* Set the GRIBEX mode off. -* GRIB files won't be always compatible with GRIBEX. -* -* @param c : the context -*/ + * Set the GRIBEX mode off. + * GRIB files won't be always compatible with GRIBEX. + * + * @param c : the context + */ void codes_gribex_mode_off(codes_context* c); @@ -1162,73 +1162,73 @@ void codes_context_set_definitions_path(codes_context* c, const char* path); void codes_context_set_samples_path(codes_context* c, const char* path); /** -* Sets memory procedures of the context -* -* @param c : the context to be modified -* @param p_malloc : the memory allocation procedure to be set @see codes_malloc_proc -* @param p_free : the memory freeing procedure to be set @see codes_free_proc -* @param p_realloc : the memory reallocation procedure to be set @see codes_realloc_proc -*/ -void codes_context_set_memory_proc(codes_context* c, codes_malloc_proc p_malloc, + * Sets memory procedures of the context + * + * @param c : the context to be modified + * @param p_malloc : the memory allocation procedure to be set @see codes_malloc_proc + * @param p_free : the memory freeing procedure to be set @see codes_free_proc + * @param p_realloc : the memory reallocation procedure to be set @see codes_realloc_proc + */ +void codes_context_set_memory_proc(codes_context* c, codes_malloc_proc p_malloc, codes_free_proc p_free, codes_realloc_proc p_realloc); /** -* Sets memory procedures of the context for persistent data -* -* @param c : the context to be modified -* @param griballoc : the memory allocation procedure to be set @see codes_malloc_proc -* @param gribfree : the memory freeing procedure to be set @see codes_free_proc -*/ + * Sets memory procedures of the context for persistent data + * + * @param c : the context to be modified + * @param griballoc : the memory allocation procedure to be set @see codes_malloc_proc + * @param gribfree : the memory freeing procedure to be set @see codes_free_proc + */ void codes_context_set_persistent_memory_proc(codes_context* c, codes_malloc_proc p_malloc, codes_free_proc p_free); /** -* Sets memory procedures of the context for large buffers -* -* @param c : the context to be modified -* @param p_malloc : the memory allocation procedure to be set @see codes_malloc_proc -* @param p_free : the memory freeing procedure to be set @see codes_free_proc -* @param p_free : the memory reallocation procedure to be set @see codes_realloc_proc -*/ -void codes_context_set_buffer_memory_proc(codes_context* c, codes_malloc_proc p_malloc, + * Sets memory procedures of the context for large buffers + * + * @param c : the context to be modified + * @param p_malloc : the memory allocation procedure to be set @see codes_malloc_proc + * @param p_free : the memory freeing procedure to be set @see codes_free_proc + * @param p_free : the memory reallocation procedure to be set @see codes_realloc_proc + */ +void codes_context_set_buffer_memory_proc(codes_context* c, codes_malloc_proc p_malloc, codes_free_proc p_free, codes_realloc_proc p_realloc); /** -* Sets the context printing procedure used for user interaction -* -* @param c : the context to be modified -* @param p_print : the printing procedure to be set @see codes_print_proc -*/ + * Sets the context printing procedure used for user interaction + * + * @param c : the context to be modified + * @param p_print : the printing procedure to be set @see codes_print_proc + */ void codes_context_set_print_proc(codes_context* c, codes_print_proc p_print); /** -* Sets the context logging procedure used for system (warning, errors, infos ...) messages -* -* @param c : the context to be modified -* @param p_log : the logging procedure to be set @see codes_log_proc -*/ + * Sets the context logging procedure used for system (warning, errors, infos ...) messages + * + * @param c : the context to be modified + * @param p_log : the logging procedure to be set @see codes_log_proc + */ void codes_context_set_logging_proc(codes_context* c, codes_log_proc p_log); /** -* Turn on support for multi-fields in single GRIB messages -* -* @param c : the context to be modified -*/ + * Turn on support for multi-fields in single GRIB messages + * + * @param c : the context to be modified + */ void codes_grib_multi_support_on(codes_context* c); /** -* Turn off support for multi-fields in single GRIB messages -* -* @param c : the context to be modified -*/ + * Turn off support for multi-fields in single GRIB messages + * + * @param c : the context to be modified + */ void codes_grib_multi_support_off(codes_context* c); /** -* Reset file handle in multiple GRIB field support mode -* -* @param c : the context to be modified -* @param f : the file pointer -*/ + * Reset file handle in multiple GRIB field support mode + * + * @param c : the context to be modified + * @param f : the file pointer + */ void codes_grib_multi_support_reset_file(codes_context* c, FILE* f); char* codes_samples_path(const codes_context* c); @@ -1236,32 +1236,32 @@ char* codes_definition_path(const codes_context* c); /*! @} */ /** -* Get the API version -* -* @return API version -*/ + * Get the API version + * + * @return API version + */ long codes_get_api_version(void); /** -* Get the Git version control SHA1 identifier -* -* @return character string with SHA1 identifier -*/ + * Get the Git version control SHA1 identifier + * + * @return character string with SHA1 identifier + */ const char* codes_get_git_sha1(void); const char* codes_get_build_date(void); /** -* Get the package name -* -* @return character string with package name -*/ + * Get the package name + * + * @return character string with package name + */ const char* codes_get_package_name(void); /** -* Prints the API version -* -*/ + * Prints the API version + * + */ void codes_print_api_version(FILE* out); /*! \defgroup keys_iterator Iterating on keys names @@ -1271,13 +1271,13 @@ attributes or by the namespace they belong to. */ /*! @{ */ /*! Create a new iterator from a valid and initialised handle. -* @param h : the handle whose keys you want to iterate -* @param filter_flags : flags to filter out some of the keys through their attributes -* @param name_space : if not null the iteration is carried out only on -* keys belonging to the namespace passed. (NULL for all the keys) -* @return keys iterator ready to iterate through keys according to filter_flags -* and namespace -*/ + * @param h : the handle whose keys you want to iterate + * @param filter_flags : flags to filter out some of the keys through their attributes + * @param name_space : if not null the iteration is carried out only on + * keys belonging to the namespace passed. (NULL for all the keys) + * @return keys iterator ready to iterate through keys according to filter_flags + * and namespace + */ codes_keys_iterator* codes_keys_iterator_new(codes_handle* h, unsigned long filter_flags, const char* name_space); /* codes_bufr_copy_data copies all the values in the data section that are present in the same position in the data tree @@ -1290,28 +1290,28 @@ int codes_bufr_copy_data(codes_handle* hin, codes_handle* hout); /*! Step to the next item from the keys iterator. -* @param kiter : valid codes_keys_iterator -* @return 1 if next iterator exists, 0 if no more elements to iterate on -*/ + * @param kiter : valid codes_keys_iterator + * @return 1 if next iterator exists, 0 if no more elements to iterate on + */ int codes_keys_iterator_next(codes_keys_iterator* kiter); /*! get the key name from the keys iterator -* @param kiter : valid codes_keys_iterator -* @return key name -*/ + * @param kiter : valid codes_keys_iterator + * @return key name + */ const char* codes_keys_iterator_get_name(const codes_keys_iterator* kiter); /*! Delete the keys iterator. -* @param kiter : valid codes_keys_iterator -* @return 0 if OK, integer value on error -*/ + * @param kiter : valid codes_keys_iterator + * @return 0 if OK, integer value on error + */ int codes_keys_iterator_delete(codes_keys_iterator* kiter); /*! Rewind the keys iterator. -* @param kiter : valid codes_keys_iterator -* @return 0 if OK, integer value on error -*/ + * @param kiter : valid codes_keys_iterator + * @return 0 if OK, integer value on error + */ int codes_keys_iterator_rewind(codes_keys_iterator* kiter); @@ -1327,17 +1327,17 @@ void codes_update_sections_lengths(codes_handle* h); /** -* Convert an error code into a string -* @param code : the error code -* @return the error message -*/ + * Convert an error code into a string + * @param code : the error code + * @return the error message + */ const char* codes_get_error_message(int code); const char* codes_get_type_name(int type); int codes_get_native_type(const codes_handle* h, const char* name, int* type); void codes_check(const char* call, const char* file, int line, int e, const char* msg); -#define CODES_CHECK(a, msg) GRIB_CHECK(a, msg) +#define CODES_CHECK(a, msg) GRIB_CHECK(a, msg) #define CODES_CHECK_NOLINE(a, msg) GRIB_CHECK_NOLINE(a, msg) @@ -1377,36 +1377,36 @@ int codes_check_message_footer(const void* bytes, size_t length, ProductKind pro /* --------------------------------------- */ -#define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL -#define CODES_UTIL_GRID_SPEC_ROTATED_LL GRIB_UTIL_GRID_SPEC_ROTATED_LL -#define CODES_UTIL_GRID_SPEC_REGULAR_GG GRIB_UTIL_GRID_SPEC_REGULAR_GG -#define CODES_UTIL_GRID_SPEC_ROTATED_GG GRIB_UTIL_GRID_SPEC_ROTATED_GG -#define CODES_UTIL_GRID_SPEC_REDUCED_GG GRIB_UTIL_GRID_SPEC_REDUCED_GG -#define CODES_UTIL_GRID_SPEC_SH GRIB_UTIL_GRID_SPEC_SH -#define CODES_UTIL_GRID_SPEC_REDUCED_LL GRIB_UTIL_GRID_SPEC_REDUCED_LL -#define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC -#define CODES_UTIL_GRID_SPEC_REDUCED_ROTATED_GG GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG -#define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA -#define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL -#define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED - -#define CODES_UTIL_PACKING_TYPE_SAME_AS_INPUT GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT -#define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX -#define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE -#define CODES_UTIL_PACKING_TYPE_JPEG GRIB_UTIL_PACKING_TYPE_JPEG -#define CODES_UTIL_PACKING_TYPE_GRID_COMPLEX GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX -#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE -#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX -#define CODES_UTIL_PACKING_TYPE_GRID_SECOND_ORDER GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER -#define CODES_UTIL_PACKING_TYPE_CCSDS GRIB_UTIL_PACKING_TYPE_CCSDS -#define CODES_UTIL_PACKING_TYPE_IEEE GRIB_UTIL_PACKING_TYPE_IEEE -#define CODES_UTIL_PACKING_SAME_AS_INPUT GRIB_UTIL_PACKING_SAME_AS_INPUT -#define CODES_UTIL_PACKING_USE_PROVIDED GRIB_UTIL_PACKING_USE_PROVIDED - -#define CODES_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT -#define CODES_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES -#define CODES_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT -#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR +#define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL +#define CODES_UTIL_GRID_SPEC_ROTATED_LL GRIB_UTIL_GRID_SPEC_ROTATED_LL +#define CODES_UTIL_GRID_SPEC_REGULAR_GG GRIB_UTIL_GRID_SPEC_REGULAR_GG +#define CODES_UTIL_GRID_SPEC_ROTATED_GG GRIB_UTIL_GRID_SPEC_ROTATED_GG +#define CODES_UTIL_GRID_SPEC_REDUCED_GG GRIB_UTIL_GRID_SPEC_REDUCED_GG +#define CODES_UTIL_GRID_SPEC_SH GRIB_UTIL_GRID_SPEC_SH +#define CODES_UTIL_GRID_SPEC_REDUCED_LL GRIB_UTIL_GRID_SPEC_REDUCED_LL +#define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC +#define CODES_UTIL_GRID_SPEC_REDUCED_ROTATED_GG GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG +#define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA +#define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL +#define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED + +#define CODES_UTIL_PACKING_TYPE_SAME_AS_INPUT GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT +#define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX +#define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE +#define CODES_UTIL_PACKING_TYPE_JPEG GRIB_UTIL_PACKING_TYPE_JPEG +#define CODES_UTIL_PACKING_TYPE_GRID_COMPLEX GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX +#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE +#define CODES_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX +#define CODES_UTIL_PACKING_TYPE_GRID_SECOND_ORDER GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER +#define CODES_UTIL_PACKING_TYPE_CCSDS GRIB_UTIL_PACKING_TYPE_CCSDS +#define CODES_UTIL_PACKING_TYPE_IEEE GRIB_UTIL_PACKING_TYPE_IEEE +#define CODES_UTIL_PACKING_SAME_AS_INPUT GRIB_UTIL_PACKING_SAME_AS_INPUT +#define CODES_UTIL_PACKING_USE_PROVIDED GRIB_UTIL_PACKING_USE_PROVIDED + +#define CODES_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT +#define CODES_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES +#define CODES_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT +#define CODES_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR codes_handle* codes_grib_util_set_spec(codes_handle* h, diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 8113e2615..58aafe2c2 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1,5 +1,5 @@ #ifdef ECCODES_ON_WINDOWS -#include + #include #endif /* action.cc */ @@ -1075,7 +1075,7 @@ void grib_math_delete(grib_context* c, grib_math* m); grib_math* grib_math_new(grib_context* c, const char* formula, int* err); /* grib_hash_keys.cc*/ -const struct grib_keys_hash* grib_keys_hash_get(const char *str, size_t len); +const struct grib_keys_hash* grib_keys_hash_get(const char* str, size_t len); grib_itrie* grib_hash_keys_new(grib_context* c, int* count); void grib_hash_keys_delete(grib_itrie* t); int grib_hash_keys_get_id(grib_itrie* t, const char* key); @@ -1341,13 +1341,13 @@ int grib_nearest_get_radius(grib_handle* h, double* radiusInKm); void grib_binary_search(const double xx[], const size_t n, double x, size_t* ju, size_t* jl); int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, const double* inlats, const double* inlons, long npoints, double* outlats, double* outlons, double* values, double* distances, int* indexes); int grib_nearest_find_generic(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, - const char* values_keyname, const char* Ni_keyname, const char* Nj_keyname, - double** out_lats, - int* out_lats_count, - double** out_lons, - int* out_lons_count, - double** out_distances, - double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); + const char* values_keyname, const char* Ni_keyname, const char* Nj_keyname, + double** out_lats, + int* out_lats_count, + double** out_lons, + int* out_lons_count, + double** out_distances, + double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); /* grib_nearest_class.cc*/ grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args); @@ -1467,8 +1467,8 @@ int string_ends_with(const char* str1, const char* str2); int string_count_char(const char* str, char c); const char* codes_get_product_name(ProductKind product); const char* grib_get_type_name(int type); -char* string_replace_char(char *str, char oldc, char newc); -void string_remove_char(char * str, char c); +char* string_replace_char(char* str, char oldc, char newc); +void string_remove_char(char* str, char c); /* functions.cc*/ long grib_op_eq(long a, long b); diff --git a/src/grib_api.h b/src/grib_api.h index 816b97d58..77d8633f0 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -23,14 +23,14 @@ #include "eccodes_windef.h" #ifndef ECCODES_ON_WINDOWS -#include + #include #endif #include #if defined(__GNUC__) || defined(__clang__) -#define ECCODES_DEPRECATED __attribute__((deprecated)) + #define ECCODES_DEPRECATED __attribute__((deprecated)) #else -#define ECCODES_DEPRECATED + #define ECCODES_DEPRECATED #endif typedef enum ProductKind @@ -51,10 +51,10 @@ extern "C" { /* sections */ #define GRIB_SECTION_PRODUCT (1 << 0) -#define GRIB_SECTION_GRID (1 << 1) -#define GRIB_SECTION_LOCAL (1 << 2) -#define GRIB_SECTION_DATA (1 << 3) -#define GRIB_SECTION_BITMAP (1 << 4) +#define GRIB_SECTION_GRID (1 << 1) +#define GRIB_SECTION_LOCAL (1 << 2) +#define GRIB_SECTION_DATA (1 << 3) +#define GRIB_SECTION_BITMAP (1 << 4) /* Log modes for processing information */ @@ -112,7 +112,7 @@ extern "C" { #define GRIB_NEAREST_SAME_POINT (1 << 2) /* Geoiterator flags */ -#define GRIB_GEOITERATOR_NO_VALUES (1 << 0) +#define GRIB_GEOITERATOR_NO_VALUES (1 << 0) /*! Iteration is carried out on all the keys available in the message \ingroup keys_iterator @@ -246,7 +246,7 @@ The grib_index is the structure giving indexed access to messages in a file. /*! @{*/ /*! index structure to access messages in a file. -*/ + */ typedef struct grib_index grib_index; /** @@ -402,47 +402,47 @@ The grib_handle is the structure giving access to parsed grib values by keys. */ /*! @{*/ /** -* Counts the messages contained in a file resource. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param f : the file resource -* @param n : the number of messages in the file -* @return 0 if OK, integer value on error -*/ + * Counts the messages contained in a file resource. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param f : the file resource + * @param n : the number of messages in the file + * @return 0 if OK, integer value on error + */ int grib_count_in_file(grib_context* c, FILE* f, int* n); /** -* Counts the messages contained in a file. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param filename : the path to the file -* @param n : the number of messages in the file -* @return 0 if OK, integer value on error -*/ + * Counts the messages contained in a file. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param filename : the path to the file + * @param n : the number of messages in the file + * @return 0 if OK, integer value on error + */ int grib_count_in_filename(grib_context* c, const char* filename, int* n); /** -* Create a handle from a file resource. -* The file is read until a message is found. The message is then copied. -* Remember always to delete the handle when it is not needed anymore to avoid -* memory leaks. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param f : the file resource -* @param error : error code set if the returned handle is NULL and the end of file is not reached -* @return the new handle, NULL if the resource is invalid or a problem is encountered -*/ + * Create a handle from a file resource. + * The file is read until a message is found. The message is then copied. + * Remember always to delete the handle when it is not needed anymore to avoid + * memory leaks. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param f : the file resource + * @param error : error code set if the returned handle is NULL and the end of file is not reached + * @return the new handle, NULL if the resource is invalid or a problem is encountered + */ grib_handle* grib_handle_new_from_file(grib_context* c, FILE* f, int* error); /** -* Write a coded message in a file. -* -* @param h : grib_handle to be written -* @param file : name of the file -* @param mode : mode -* @return 0 if OK, integer value on error -*/ + * Write a coded message in a file. + * + * @param h : grib_handle to be written + * @param file : name of the file + * @param mode : mode + * @return 0 if OK, integer value on error + */ int grib_write_message(const grib_handle* h, const char* file, const char* mode); typedef struct grib_string_list grib_string_list; @@ -458,39 +458,39 @@ grib_string_list* grib_util_get_param_id(const char* mars_param); grib_string_list* grib_util_get_mars_param(const char* param_id); /** -* Create a handle from a user message in memory. The message will not be freed at the end. -* The message will be copied as soon as a modification is needed. -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param data : the actual message -* @param data_len : the length of the message in number of bytes -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Create a handle from a user message in memory. The message will not be freed at the end. + * The message will be copied as soon as a modification is needed. + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param data : the actual message + * @param data_len : the length of the message in number of bytes + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ grib_handle* grib_handle_new_from_message(grib_context* c, const void* data, size_t data_len); /** -* Create a handle from a user message in memory. The message will not be freed at the end. -* The message will be copied as soon as a modification is needed. -* This function works also with multi-field messages. -* Note: The data pointer argument may be modified -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param data : the actual message -* @param data_len : the length of the message in number of bytes -* @param error : error code -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Create a handle from a user message in memory. The message will not be freed at the end. + * The message will be copied as soon as a modification is needed. + * This function works also with multi-field messages. + * Note: The data pointer argument may be modified + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param data : the actual message + * @param data_len : the length of the message in number of bytes + * @param error : error code + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ grib_handle* grib_handle_new_from_multi_message(grib_context* c, void** data, size_t* data_len, int* error); /** -* Create a handle from a user message. The message is copied and will be freed with the handle -* -* @param c : the context from which the handle will be created (NULL for default context) -* @param data : the actual message -* @param data_len : the length of the message in number of bytes -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Create a handle from a user message. The message is copied and will be freed with the handle + * + * @param c : the context from which the handle will be created (NULL for default context) + * @param data : the actual message + * @param data_len : the length of the message in number of bytes + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ grib_handle* grib_handle_new_from_message_copy(grib_context* c, const void* data, size_t data_len); @@ -506,20 +506,20 @@ grib_handle* grib_handle_new_from_samples(grib_context* c, const char* sample_na /** -* Clone an existing handle using the context of the original handle, -* The message is copied and reparsed -* -* @param h : The handle to be cloned -* @return the new handle, NULL if the message is invalid or a problem is encountered -*/ + * Clone an existing handle using the context of the original handle, + * The message is copied and reparsed + * + * @param h : The handle to be cloned + * @return the new handle, NULL if the message is invalid or a problem is encountered + */ grib_handle* grib_handle_clone(const grib_handle* h); /** -* Frees a handle, also frees the message if it is not a user message -* @see grib_handle_new_from_message -* @param h : The handle to be deleted -* @return 0 if OK, integer value on error -*/ + * Frees a handle, also frees the message if it is not a user message + * @see grib_handle_new_from_message + * @param h : The handle to be deleted + * @return 0 if OK, integer value on error + */ int grib_handle_delete(grib_handle* h); /** @@ -568,25 +568,25 @@ int grib_multi_handle_write(grib_multi_handle* mh, FILE* f); /*! \defgroup handling_coded_messages Handling coded messages */ /*! @{ */ /** -* getting the message attached to a handle -* -* @param h : the handle to which the buffer should be gathered -* @param message : the pointer to be set to the handle's data -* @param message_length : On exit, the message size in number of bytes -* @return 0 if OK, integer value on error -*/ + * getting the message attached to a handle + * + * @param h : the handle to which the buffer should be gathered + * @param message : the pointer to be set to the handle's data + * @param message_length : On exit, the message size in number of bytes + * @return 0 if OK, integer value on error + */ int grib_get_message(const grib_handle* h, const void** message, size_t* message_length); /** -* getting a copy of the message attached to a handle -* -* @param h : the handle to which the buffer should be returned -* @param message : the pointer to the data buffer to be filled -* @param message_length : On entry, the size in number of bytes of the allocated empty message. -* On exit, the actual message length in number of bytes -* @return 0 if OK, integer value on error -*/ + * getting a copy of the message attached to a handle + * + * @param h : the handle to which the buffer should be returned + * @param message : the pointer to the data buffer to be filled + * @param message_length : On entry, the size in number of bytes of the allocated empty message. + * On exit, the actual message length in number of bytes + * @return 0 if OK, integer value on error + */ int grib_get_message_copy(const grib_handle* h, void* message, size_t* message_length); /*! @} */ @@ -594,140 +594,140 @@ int grib_get_message_copy(const grib_handle* h, void* message, size_t* message_l /*! @{ */ /*! -* \brief Create a new geoiterator from a handle, using current geometry and values. -* -* \param h : the handle from which the geoiterator will be created -* \param flags : flags for future use. -* \param error : error code -* \return the new geoiterator, NULL if no geoiterator can be created -*/ + * \brief Create a new geoiterator from a handle, using current geometry and values. + * + * \param h : the handle from which the geoiterator will be created + * \param flags : flags for future use. + * \param error : error code + * \return the new geoiterator, NULL if no geoiterator can be created + */ grib_iterator* grib_iterator_new(const grib_handle* h, unsigned long flags, int* error); /** -* Get latitude/longitude and data values. -* The Latitudes, longitudes and values arrays must be properly allocated by the caller. -* Their required dimension can be obtained by getting the value of the integer key "numberOfPoints". -* -* @param h : handle from which geography and data values are taken -* @param lats : returned array of latitudes -* @param lons : returned array of longitudes -* @param values : returned array of data values -* @return 0 if OK, integer value on error -*/ + * Get latitude/longitude and data values. + * The Latitudes, longitudes and values arrays must be properly allocated by the caller. + * Their required dimension can be obtained by getting the value of the integer key "numberOfPoints". + * + * @param h : handle from which geography and data values are taken + * @param lats : returned array of latitudes + * @param lons : returned array of longitudes + * @param values : returned array of data values + * @return 0 if OK, integer value on error + */ int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values); /** -* Get the next value from a geoiterator. -* -* @param i : the geoiterator -* @param lat : on output latitude in degree -* @param lon : on output longitude in degree -* @param value : on output value of the point -* @return positive value if successful, 0 if no more data are available -*/ + * Get the next value from a geoiterator. + * + * @param i : the geoiterator + * @param lat : on output latitude in degree + * @param lon : on output longitude in degree + * @param value : on output value of the point + * @return positive value if successful, 0 if no more data are available + */ int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value); /** -* Get the previous value from a geoiterator. -* -* @param i : the geoiterator -* @param lat : on output latitude in degree -* @param lon : on output longitude in degree -* @param value : on output value of the point* -* @return positive value if successful, 0 if no more data are available -*/ + * Get the previous value from a geoiterator. + * + * @param i : the geoiterator + * @param lat : on output latitude in degree + * @param lon : on output longitude in degree + * @param value : on output value of the point* + * @return positive value if successful, 0 if no more data are available + */ int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value); /** -* Test procedure for values in a geoiterator. -* -* @param i : the geoiterator -* @return boolean, 1 if the geoiterator still nave next values, 0 otherwise -*/ + * Test procedure for values in a geoiterator. + * + * @param i : the geoiterator + * @return boolean, 1 if the geoiterator still nave next values, 0 otherwise + */ int grib_iterator_has_next(grib_iterator* i); /** -* Test procedure for values in a geoiterator. -* -* @param i : the geoiterator -* @return 0 if OK, integer value on error -*/ + * Test procedure for values in a geoiterator. + * + * @param i : the geoiterator + * @return 0 if OK, integer value on error + */ int grib_iterator_reset(grib_iterator* i); /** -* Frees a geoiterator from memory -* -* @param i : the geoiterator -* @return 0 if OK, integer value on error -*/ + * Frees a geoiterator from memory + * + * @param i : the geoiterator + * @return 0 if OK, integer value on error + */ int grib_iterator_delete(grib_iterator* i); /*! -* \brief Create a new nearest neighbour object from a handle, using current geometry. -* -* \param h : the handle from which the nearest object will be created -* \param error : error code -* \return the new nearest, NULL if no nearest can be created -*/ + * \brief Create a new nearest neighbour object from a handle, using current geometry. + * + * \param h : the handle from which the nearest object will be created + * \param error : error code + * \return the new nearest, NULL if no nearest can be created + */ grib_nearest* grib_nearest_new(const grib_handle* h, int* error); /** -* Find the 4 nearest points of a latitude longitude point. -* The flags are provided to speed up the process of searching. If you are -* sure that the point you are asking for is not changing from a call -* to another you can use GRIB_NEAREST_SAME_POINT. The same is valid for -* the grid. Flags can be used together doing a bitwise OR. -* The distances are given in kilometres. -* -* @param nearest : nearest structure -* @param h : handle from which geography and data values are taken -* @param inlat : latitude of the point to search for -* @param inlon : longitude of the point to search for -* @param flags : GRIB_NEAREST_SAME_POINT, GRIB_NEAREST_SAME_GRID -* @param outlats : returned array of latitudes of the nearest points -* @param outlons : returned array of longitudes of the nearest points -* @param values : returned array of data values of the nearest points -* @param distances : returned array of distances from the nearest points -* @param indexes : returned array of indexes of the nearest points -* @param len : size of the arrays -* @return 0 if OK, integer value on error -*/ + * Find the 4 nearest points of a latitude longitude point. + * The flags are provided to speed up the process of searching. If you are + * sure that the point you are asking for is not changing from a call + * to another you can use GRIB_NEAREST_SAME_POINT. The same is valid for + * the grid. Flags can be used together doing a bitwise OR. + * The distances are given in kilometres. + * + * @param nearest : nearest structure + * @param h : handle from which geography and data values are taken + * @param inlat : latitude of the point to search for + * @param inlon : longitude of the point to search for + * @param flags : GRIB_NEAREST_SAME_POINT, GRIB_NEAREST_SAME_GRID + * @param outlats : returned array of latitudes of the nearest points + * @param outlons : returned array of longitudes of the nearest points + * @param values : returned array of data values of the nearest points + * @param distances : returned array of distances from the nearest points + * @param indexes : returned array of indexes of the nearest points + * @param len : size of the arrays + * @return 0 if OK, integer value on error + */ int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); /** -* Frees a nearest neighbour object from memory -* -* @param nearest : the nearest -* @return 0 if OK, integer value on error -*/ + * Frees a nearest neighbour object from memory + * + * @param nearest : the nearest + * @return 0 if OK, integer value on error + */ int grib_nearest_delete(grib_nearest* nearest); /** -* Find the nearest point of a set of points whose latitudes and longitudes -* are given in the inlats, inlons arrays respectively. -* If the flag is_lsm is 1 the nearest land point is returned and the -* GRIB passed as handle (h) is considered a land sea mask. -* The land nearest point is the nearest point with land sea mask value>=0.5. -* If no nearest land points are found the nearest value is returned. -* If the flag is_lsm is 0 the nearest point is returned. -* values, distances, indexes (in the "values" array) for the nearest points (ilons,ilats) -* are returned. -* The distances are given in kilometres. -* -* @param h : handle from which geography and data values are taken -* @param is_lsm : lsm flag (1-> nearest land, 0-> nearest) -* @param inlats : latitudes of the points to search for -* @param inlons : longitudes of the points to search for -* @param npoints : number of points (size of the inlats,inlons,outlats,outlons,values,distances,indexes arrays) -* @param outlats : returned array of latitudes of the nearest points -* @param outlons : returned array of longitudes of the nearest points -* @param values : returned array of data values of the nearest points -* @param distances : returned array of distances from the nearest points -* @param indexes : returned array of indexes of the nearest points -* @return 0 if OK, integer value on error -*/ + * Find the nearest point of a set of points whose latitudes and longitudes + * are given in the inlats, inlons arrays respectively. + * If the flag is_lsm is 1 the nearest land point is returned and the + * GRIB passed as handle (h) is considered a land sea mask. + * The land nearest point is the nearest point with land sea mask value>=0.5. + * If no nearest land points are found the nearest value is returned. + * If the flag is_lsm is 0 the nearest point is returned. + * values, distances, indexes (in the "values" array) for the nearest points (ilons,ilats) + * are returned. + * The distances are given in kilometres. + * + * @param h : handle from which geography and data values are taken + * @param is_lsm : lsm flag (1-> nearest land, 0-> nearest) + * @param inlats : latitudes of the points to search for + * @param inlons : longitudes of the points to search for + * @param npoints : number of points (size of the inlats,inlons,outlats,outlons,values,distances,indexes arrays) + * @param outlats : returned array of latitudes of the nearest points + * @param outlons : returned array of longitudes of the nearest points + * @param values : returned array of data values of the nearest points + * @param distances : returned array of distances from the nearest points + * @param indexes : returned array of indexes of the nearest points + * @return 0 if OK, integer value on error + */ int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, const double* inlats, const double* inlons, long npoints, double* outlats, double* outlons, @@ -738,261 +738,261 @@ int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, /*! \defgroup get_set Accessing header and data values */ /*! @{ */ /** -* Get the number offset of a key, in a message if several keys of the same name -* are present, the offset of the last one is returned -* -* @param h : the handle to get the offset from -* @param key : the key to be searched -* @param offset : the address of a size_t where the offset will be set -* @return 0 if OK, integer value on error -*/ + * Get the number offset of a key, in a message if several keys of the same name + * are present, the offset of the last one is returned + * + * @param h : the handle to get the offset from + * @param key : the key to be searched + * @param offset : the address of a size_t where the offset will be set + * @return 0 if OK, integer value on error + */ int grib_get_offset(const grib_handle* h, const char* key, size_t* offset); /** -* Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned -* -* @param h : the handle to get the offset from -* @param key : the key to be searched -* @param size : the address of a size_t where the size will be set -* @return 0 if OK, integer value on error -*/ + * Get the number of coded value from a key, if several keys of the same name are present, the total sum is returned + * + * @param h : the handle to get the offset from + * @param key : the key to be searched + * @param size : the address of a size_t where the size will be set + * @return 0 if OK, integer value on error + */ int grib_get_size(const grib_handle* h, const char* key, size_t* size); /** -* Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned -* -* @param h : the handle to get the offset from -* @param key : the key to be searched -* @param length : the address of a size_t where the length will be set -* @return 0 if OK, integer value on error -*/ + * Get the length of the string representation of the key, if several keys of the same name are present, the maximum length is returned + * + * @param h : the handle to get the offset from + * @param key : the key to be searched + * @param length : the address of a size_t where the length will be set + * @return 0 if OK, integer value on error + */ int grib_get_length(const grib_handle* h, const char* key, size_t* length); /** -* Get a long value from a key, if several keys of the same name are present, the last one is returned -* @see grib_set_long -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param value : the address of a long where the data will be retrieved -* @return 0 if OK, integer value on error -*/ + * Get a long value from a key, if several keys of the same name are present, the last one is returned + * @see grib_set_long + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param value : the address of a long where the data will be retrieved + * @return 0 if OK, integer value on error + */ int grib_get_long(const grib_handle* h, const char* key, long* value); /** -* Get a double value from a key, if several keys of the same name are present, the last one is returned -* @see grib_set_double -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param value : the address of a double where the data will be retrieved -* @return 0 if OK, integer value on error -*/ + * Get a double value from a key, if several keys of the same name are present, the last one is returned + * @see grib_set_double + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param value : the address of a double where the data will be retrieved + * @return 0 if OK, integer value on error + */ int grib_get_double(const grib_handle* h, const char* key, double* value); /** -* Get as double the i-th element of the "key" array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param i : zero-based index -* @param value : the address of a double where the data will be retrieved -* @return 0 if OK, integer value on error -*/ + * Get as double the i-th element of the "key" array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param i : zero-based index + * @param value : the address of a double where the data will be retrieved + * @return 0 if OK, integer value on error + */ int grib_get_double_element(const grib_handle* h, const char* key, int i, double* value); /** -* Get as double array the elements of the "key" array whose indexes are listed in the input array "index_array" -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param index_array : zero-based array of indexes -* @param size : size of the index_array and value arrays -* @param value : the double array for the data values -* @return 0 if OK, integer value on error -*/ + * Get as double array the elements of the "key" array whose indexes are listed in the input array "index_array" + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param index_array : zero-based array of indexes + * @param size : size of the index_array and value arrays + * @param value : the double array for the data values + * @return 0 if OK, integer value on error + */ int grib_get_double_elements(const grib_handle* h, const char* key, const int* index_array, long size, double* value); /** -* Get a string value from a key, if several keys of the same name are present, the last one is returned -* @see grib_set_string -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param mesg : the address of a string where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output -* @return 0 if OK, integer value on error -*/ + * Get a string value from a key, if several keys of the same name are present, the last one is returned + * @see grib_set_string + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param mesg : the address of a string where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the string on input, and that contains the actual length of the string on output + * @return 0 if OK, integer value on error + */ int grib_get_string(const grib_handle* h, const char* key, char* mesg, size_t* length); /** -* Get string array values from a key. If several keys of the same name are present, the last one is returned -* @see grib_set_string_array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param vals : the address of a string array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output -* @return 0 if OK, integer value on error -*/ + * Get string array values from a key. If several keys of the same name are present, the last one is returned + * @see grib_set_string_array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param vals : the address of a string array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the array on input, and that contains the actual length of the array on output + * @return 0 if OK, integer value on error + */ int grib_get_string_array(const grib_handle* h, const char* key, char** vals, size_t* length); /** -* Get raw bytes values from a key. If several keys of the same name are present, the last one is returned -* @see grib_set_bytes -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param bytes : the address of a byte array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output -* @return 0 if OK, integer value on error -*/ + * Get raw bytes values from a key. If several keys of the same name are present, the last one is returned + * @see grib_set_bytes + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param bytes : the address of a byte array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the byte array on input, and that contains the actual length of the byte array on output + * @return 0 if OK, integer value on error + */ int grib_get_bytes(const grib_handle* h, const char* key, unsigned char* bytes, size_t* length); /** -* Get double array values from a key. If several keys of the same name are present, the last one is returned -* @see grib_set_double_array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param vals : the address of a double array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output -* @return 0 if OK, integer value on error -*/ + * Get double array values from a key. If several keys of the same name are present, the last one is returned + * @see grib_set_double_array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param vals : the address of a double array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the double array on input, and that contains the actual length of the double array on output + * @return 0 if OK, integer value on error + */ int grib_get_double_array(const grib_handle* h, const char* key, double* vals, size_t* length); /** -* Get long array values from a key. If several keys of the same name are present, the last one is returned -* @see grib_set_long_array -* -* @param h : the handle to get the data from -* @param key : the key to be searched -* @param vals : the address of a long array where the data will be retrieved -* @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output -* @return 0 if OK, integer value on error -*/ + * Get long array values from a key. If several keys of the same name are present, the last one is returned + * @see grib_set_long_array + * + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param vals : the address of a long array where the data will be retrieved + * @param length : the address of a size_t that contains allocated length of the long array on input, and that contains the actual length of the long array on output + * @return 0 if OK, integer value on error + */ int grib_get_long_array(const grib_handle* h, const char* key, long* vals, size_t* length); /* setting data */ /** -* Copy the keys belonging to a given namespace from a source handle to a destination handle -* -* -* @param dest : destination handle -* @param name : namespace -* @param src : source handle -* @return 0 if OK, integer value on error -*/ + * Copy the keys belonging to a given namespace from a source handle to a destination handle + * + * + * @param dest : destination handle + * @param name : namespace + * @param src : source handle + * @return 0 if OK, integer value on error + */ int grib_copy_namespace(grib_handle* dest, const char* name, grib_handle* src); /** -* Set a long value from a key. If several keys of the same name are present, the last one is set -* @see grib_get_long -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param val : a long where the data will be read -* @return 0 if OK, integer value on error -*/ + * Set a long value from a key. If several keys of the same name are present, the last one is set + * @see grib_get_long + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param val : a long where the data will be read + * @return 0 if OK, integer value on error + */ int grib_set_long(grib_handle* h, const char* key, long val); /** -* Set a double value from a key. If several keys of the same name are present, the last one is set -* @see grib_get_double -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param val : a double where the data will be read -* @return 0 if OK, integer value on error -*/ + * Set a double value from a key. If several keys of the same name are present, the last one is set + * @see grib_get_double + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param val : a double where the data will be read + * @return 0 if OK, integer value on error + */ int grib_set_double(grib_handle* h, const char* key, double val); /** -* Set a string value from a key. If several keys of the same name are present, the last one is set -* @see grib_get_string -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param mesg : the address of a string where the data will be read -* @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output -* @return 0 if OK, integer value on error -*/ + * Set a string value from a key. If several keys of the same name are present, the last one is set + * @see grib_get_string + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param mesg : the address of a string where the data will be read + * @param length : the address of a size_t that contains the length of the string on input, and that contains the actual packed length of the string on output + * @return 0 if OK, integer value on error + */ int grib_set_string(grib_handle* h, const char* key, const char* mesg, size_t* length); /** -* Set a bytes array from a key. If several keys of the same name are present, the last one is set -* @see grib_get_bytes -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param bytes : the address of a byte array where the data will be read -* @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output -* @return 0 if OK, integer value on error -*/ + * Set a bytes array from a key. If several keys of the same name are present, the last one is set + * @see grib_get_bytes + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param bytes : the address of a byte array where the data will be read + * @param length : the address of a size_t that contains the length of the byte array on input, and that contains the actual packed length of the byte array on output + * @return 0 if OK, integer value on error + */ int grib_set_bytes(grib_handle* h, const char* key, const unsigned char* bytes, size_t* length); /** -* Set a double array from a key. If several keys of the same name are present, the last one is set -* @see grib_get_double_array -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param vals : the address of a double array where the data will be read -* @param length : a size_t that contains the length of the byte array on input -* @return 0 if OK, integer value on error -*/ + * Set a double array from a key. If several keys of the same name are present, the last one is set + * @see grib_get_double_array + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param vals : the address of a double array where the data will be read + * @param length : a size_t that contains the length of the byte array on input + * @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); /** -* Same as grib_set_double_array but allows setting of READ-ONLY keys like codedValues. -* Use with great caution!! -*/ + * 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); /** -* Set a long array from a key. If several keys of the same name are present, the last one is set -* @see grib_get_long_array -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param vals : the address of a long array where the data will be read -* @param length : a size_t that contains the length of the long array on input -* @return 0 if OK, integer value on error -*/ + * Set a long array from a key. If several keys of the same name are present, the last one is set + * @see grib_get_long_array + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param vals : the address of a long array where the data will be read + * @param length : a size_t that contains the length of the long array on input + * @return 0 if OK, integer value on error + */ int grib_set_long_array(grib_handle* h, const char* key, const long* vals, size_t length); /** -* Set a string array from a key. If several keys of the same name are present, the last one is set -* @see grib_get_string_array -* -* @param h : the handle to set the data to -* @param key : the key to be searched -* @param vals : the address of a string array where the data will be read -* @param length : a size_t that contains the length of the array on input -* @return 0 if OK, integer value on error -*/ + * Set a string array from a key. If several keys of the same name are present, the last one is set + * @see grib_get_string_array + * + * @param h : the handle to set the data to + * @param key : the key to be searched + * @param vals : the address of a string array where the data will be read + * @param length : a size_t that contains the length of the array on input + * @return 0 if OK, integer value on error + */ int grib_set_string_array(grib_handle* h, const char* key, const char** vals, size_t length); /*! @} */ /** -* Print all keys, with the context print procedure and dump mode to a resource -* -* @param h : the handle to be printed -* @param out : output file handle -* @param mode : Examples of available dump modes: debug wmo -* @param option_flags : all the GRIB_DUMP_FLAG_x flags can be used -* @param arg : used to provide a format to output data (experimental) -*/ + * Print all keys, with the context print procedure and dump mode to a resource + * + * @param h : the handle to be printed + * @param out : output file handle + * @param mode : Examples of available dump modes: debug wmo + * @param option_flags : all the GRIB_DUMP_FLAG_x flags can be used + * @param arg : used to provide a format to output data (experimental) + */ void grib_dump_content(const grib_handle* h, FILE* out, const char* mode, unsigned long option_flags, void* arg); /** -* Print all keys from the parsed definition files available in a context -* -* @param f : the File used to print the keys on -* @param c : the context that contains the cached definition files to be printed -*/ + * Print all keys from the parsed definition files available in a context + * + * @param f : the File used to print the keys on + * @param c : the context that contains the cached definition files to be printed + */ void grib_dump_action_tree(grib_context* c, FILE* f); /*! \defgroup context The context object @@ -1002,80 +1002,80 @@ void grib_dump_action_tree(grib_context* c, FILE* f); */ /*! @{ */ /** -* free procedure, format of a procedure referenced in the context that is used to free memory -* -* @param c : the context where the memory freeing will apply -* @param data : pointer to the data to be freed -* must match @see grib_malloc_proc -*/ + * free procedure, format of a procedure referenced in the context that is used to free memory + * + * @param c : the context where the memory freeing will apply + * @param data : pointer to the data to be freed + * must match @see grib_malloc_proc + */ typedef void (*grib_free_proc)(const grib_context* c, void* data); /** -* malloc procedure, format of a procedure referenced in the context that is used to allocate memory -* @param c : the context where the memory allocation will apply -* @param length : length to be allocated in number of bytes -* @return a pointer to the allocated memory, NULL if no memory can be allocated -* must match @see grib_free_proc -*/ + * malloc procedure, format of a procedure referenced in the context that is used to allocate memory + * @param c : the context where the memory allocation will apply + * @param length : length to be allocated in number of bytes + * @return a pointer to the allocated memory, NULL if no memory can be allocated + * must match @see grib_free_proc + */ typedef void* (*grib_malloc_proc)(const grib_context* c, size_t length); /** -* realloc procedure, format of a procedure referenced in the context that is used to reallocate memory -* @param c : the context where the memory allocation will apply -* @param data : pointer to the data to be reallocated -* @param length : length to be allocated in number of bytes -* @return a pointer to the allocated memory -*/ + * realloc procedure, format of a procedure referenced in the context that is used to reallocate memory + * @param c : the context where the memory allocation will apply + * @param data : pointer to the data to be reallocated + * @param length : length to be allocated in number of bytes + * @return a pointer to the allocated memory + */ typedef void* (*grib_realloc_proc)(const grib_context* c, void* data, size_t length); /** -* log procedure, format of a procedure referenced in the context that is used to log internal messages -* -* @param c : the context where the logging will apply -* @param level : the log level, as defined in log modes -* @param mesg : the message to be logged -*/ + * log procedure, format of a procedure referenced in the context that is used to log internal messages + * + * @param c : the context where the logging will apply + * @param level : the log level, as defined in log modes + * @param mesg : the message to be logged + */ typedef void (*grib_log_proc)(const grib_context* c, int level, const char* mesg); /** -* print procedure, format of a procedure referenced in the context that is used to print external messages -* -* @param c : the context where the logging will apply -* @param descriptor : the structure to be printed on, must match the implementation -* @param mesg : the message to be printed -*/ + * print procedure, format of a procedure referenced in the context that is used to print external messages + * + * @param c : the context where the logging will apply + * @param descriptor : the structure to be printed on, must match the implementation + * @param mesg : the message to be printed + */ typedef void (*grib_print_proc)(const grib_context* c, void* descriptor, const char* mesg); /** -* data read procedure, format of a procedure referenced in the context that is used to read from a stream in a resource -* -* @param c : the context where the read will apply -* @param ptr : the resource -* @param size : size to read -* @param stream : the stream -* @return size read -*/ + * data read procedure, format of a procedure referenced in the context that is used to read from a stream in a resource + * + * @param c : the context where the read will apply + * @param ptr : the resource + * @param size : size to read + * @param stream : the stream + * @return size read + */ typedef size_t (*grib_data_read_proc)(const grib_context* c, void* ptr, size_t size, void* stream); /** -* data write procedure, format of a procedure referenced in the context that is used to write to a stream from a resource -* -* @param c : the context where the write will apply -* @param ptr : the resource -* @param size : size to read -* @param stream : the stream -* @return size written -*/ + * data write procedure, format of a procedure referenced in the context that is used to write to a stream from a resource + * + * @param c : the context where the write will apply + * @param ptr : the resource + * @param size : size to read + * @param stream : the stream + * @return size written + */ typedef size_t (*grib_data_write_proc)(const grib_context* c, const void* ptr, size_t size, void* stream); /** -* data tell procedure, format of a procedure referenced in the context that is used to tell the current position in a stream -* -* @param c : the context where the tell will apply -* @param stream : the stream -* @return the position in the stream -*/ + * data tell procedure, format of a procedure referenced in the context that is used to tell the current position in a stream + * + * @param c : the context where the tell will apply + * @param stream : the stream + * @return the position in the stream + */ typedef off_t (*grib_data_tell_proc)(const grib_context* c, void* stream); /** @@ -1091,65 +1091,65 @@ typedef off_t (*grib_data_tell_proc)(const grib_context* c, void* stream); typedef off_t (*grib_data_seek_proc)(const grib_context* c, off_t offset, int whence, void* stream); /** -* data eof procedure, format of a procedure referenced in the context that is used to test end of file -* -* @param c : the context where the tell will apply -* @param stream : the stream -* @return the position in the stream -*/ + * data eof procedure, format of a procedure referenced in the context that is used to test end of file + * + * @param c : the context where the tell will apply + * @param stream : the stream + * @return the position in the stream + */ typedef int (*grib_data_eof_proc)(const grib_context* c, void* stream); /** -* Get the static default context -* -* @return the default context, NULL it the context is not available -*/ + * Get the static default context + * + * @return the default context, NULL it the context is not available + */ grib_context* grib_context_get_default(void); /** -* Frees the cached definition files of the context -* -* @param c : the context to be deleted -*/ + * Frees the cached definition files of the context + * + * @param c : the context to be deleted + */ void grib_context_delete(grib_context* c); /** -* Set the GTS header mode on. -* The GTS headers will be preserved. -* -* @param c : the context -*/ + * Set the GTS header mode on. + * The GTS headers will be preserved. + * + * @param c : the context + */ void grib_gts_header_on(grib_context* c); /** -* Set the GTS header mode off. -* The GTS headers will be deleted. -* -* @param c : the context -*/ + * Set the GTS header mode off. + * The GTS headers will be deleted. + * + * @param c : the context + */ void grib_gts_header_off(grib_context* c); /** -* Set the GRIBEX mode on. -* Grib files will be compatible with GRIBEX. -* -* @param c : the context -*/ + * Set the GRIBEX mode on. + * Grib files will be compatible with GRIBEX. + * + * @param c : the context + */ void grib_gribex_mode_on(grib_context* c); /** -* Get the GRIBEX mode. -* -* @param c : the context -*/ + * Get the GRIBEX mode. + * + * @param c : the context + */ int grib_get_gribex_mode(grib_context* c); /** -* Set the GRIBEX mode off. -* GRIB files won't be always compatible with GRIBEX. -* -* @param c : the context -*/ + * Set the GRIBEX mode off. + * GRIB files won't be always compatible with GRIBEX. + * + * @param c : the context + */ void grib_gribex_mode_off(grib_context* c); /** @@ -1169,73 +1169,73 @@ void grib_context_set_definitions_path(grib_context* c, const char* path); void grib_context_set_samples_path(grib_context* c, const char* path); /** -* Sets memory procedures of the context -* -* @param c : the context to be modified -* @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc -* @param gribfree : the memory freeing procedure to be set @see grib_free_proc -*/ + * Sets memory procedures of the context + * + * @param c : the context to be modified + * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc + * @param gribfree : the memory freeing procedure to be set @see grib_free_proc + */ void grib_context_set_memory_proc(grib_context* c, grib_malloc_proc griballoc, grib_free_proc gribfree, grib_realloc_proc gribrealloc); /** -* Sets memory procedures of the context for persistent data -* -* @param c : the context to be modified -* @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc -* @param gribfree : the memory freeing procedure to be set @see grib_free_proc -*/ + * Sets memory procedures of the context for persistent data + * + * @param c : the context to be modified + * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc + * @param gribfree : the memory freeing procedure to be set @see grib_free_proc + */ void grib_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc griballoc, grib_free_proc gribfree); /** -* Sets memory procedures of the context for large buffers -* -* @param c : the context to be modified -* @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc -* @param gribfree : the memory freeing procedure to be set @see grib_free_proc -*/ + * Sets memory procedures of the context for large buffers + * + * @param c : the context to be modified + * @param griballoc : the memory allocation procedure to be set @see grib_malloc_proc + * @param gribfree : the memory freeing procedure to be set @see grib_free_proc + */ void grib_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc griballoc, grib_free_proc gribfree, grib_realloc_proc gribrealloc); /** -* Sets the context printing procedure used for user interaction -* -* @param c : the context to be modified -* @param printp : the printing procedure to be set @see grib_print_proc -*/ + * Sets the context printing procedure used for user interaction + * + * @param c : the context to be modified + * @param printp : the printing procedure to be set @see grib_print_proc + */ void grib_context_set_print_proc(grib_context* c, grib_print_proc printp); /** -* Sets the context logging procedure used for system (warning, errors, infos ...) messages -* -* @param c : the context to be modified -* @param logp : the logging procedure to be set @see grib_log_proc -*/ + * Sets the context logging procedure used for system (warning, errors, infos ...) messages + * + * @param c : the context to be modified + * @param logp : the logging procedure to be set @see grib_log_proc + */ void grib_context_set_logging_proc(grib_context* c, grib_log_proc logp); /** -* Turn on support for multi-fields in single GRIB messages -* -* @param c : the context to be modified -*/ + * Turn on support for multi-fields in single GRIB messages + * + * @param c : the context to be modified + */ void grib_multi_support_on(grib_context* c); /** -* Turn off support for multi-fields in single GRIB messages -* -* @param c : the context to be modified -*/ + * Turn off support for multi-fields in single GRIB messages + * + * @param c : the context to be modified + */ void grib_multi_support_off(grib_context* c); /** -* Reset file handle in multi-field support mode -* -* @param c : the context to be modified -* @param f : the file pointer -*/ + * Reset file handle in multi-field support mode + * + * @param c : the context to be modified + * @param f : the file pointer + */ void grib_multi_support_reset_file(grib_context* c, FILE* f); char* grib_samples_path(const grib_context* c); @@ -1243,29 +1243,29 @@ char* grib_definition_path(const grib_context* c); /*! @} */ /** -* Get the API version -* -* @return API version -*/ + * Get the API version + * + * @return API version + */ long grib_get_api_version(void); /** -* Get the Git version control SHA1 identifier -* -* @return character string with SHA1 identifier -*/ + * Get the Git version control SHA1 identifier + * + * @return character string with SHA1 identifier + */ const char* grib_get_git_sha1(void); /** -* Get the package name -* -* @return character string with package name -*/ + * Get the package name + * + * @return character string with package name + */ const char* grib_get_package_name(void); /** -* Prints the API version -*/ + * Prints the API version + */ void grib_print_api_version(FILE* out); /*! \defgroup keys_iterator Iterating on keys names @@ -1275,42 +1275,42 @@ attributes or by the namespace they belong to. */ /*! @{ */ /*! Create a new iterator from a valid and initialised handle. -* @param h : the handle whose keys you want to iterate -* @param filter_flags : flags to filter out some of the keys through their attributes -* @param name_space : if not null the iteration is carried out only on -* keys belonging to the namespace passed. (NULL for all the keys) -* @return keys iterator ready to iterate through keys according to filter_flags -* and namespace -*/ + * @param h : the handle whose keys you want to iterate + * @param filter_flags : flags to filter out some of the keys through their attributes + * @param name_space : if not null the iteration is carried out only on + * keys belonging to the namespace passed. (NULL for all the keys) + * @return keys iterator ready to iterate through keys according to filter_flags + * and namespace + */ grib_keys_iterator* grib_keys_iterator_new(grib_handle* h, unsigned long filter_flags, const char* name_space); bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h, unsigned long filter_flags); bufr_keys_iterator* codes_bufr_data_section_keys_iterator_new(grib_handle* h); /*! Step to the next iterator. -* @param kiter : valid grib_keys_iterator -* @return 1 if next iterator exists, 0 if no more elements to iterate on -*/ + * @param kiter : valid grib_keys_iterator + * @return 1 if next iterator exists, 0 if no more elements to iterate on + */ int grib_keys_iterator_next(grib_keys_iterator* kiter); int codes_bufr_keys_iterator_next(bufr_keys_iterator* kiter); /*! get the key name from the iterator -* @param kiter : valid grib_keys_iterator -* @return key name -*/ + * @param kiter : valid grib_keys_iterator + * @return key name + */ const char* grib_keys_iterator_get_name(const grib_keys_iterator* kiter); char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* kiter); /*! Delete the iterator. -* @param kiter : valid grib_keys_iterator -* @return 0 if OK, integer value on error -*/ + * @param kiter : valid grib_keys_iterator + * @return 0 if OK, integer value on error + */ int grib_keys_iterator_delete(grib_keys_iterator* kiter); int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter); /*! Rewind the iterator. -* @param kiter : valid grib_keys_iterator -* @return 0 if OK, integer value on error -*/ + * @param kiter : valid grib_keys_iterator + * @return 0 if OK, integer value on error + */ int grib_keys_iterator_rewind(grib_keys_iterator* kiter); int codes_bufr_keys_iterator_rewind(bufr_keys_iterator* kiter); @@ -1328,17 +1328,17 @@ void grib_update_sections_lengths(grib_handle* h); /** -* Convert an error code into a string -* @param code : the error code -* @return the error message -*/ + * Convert an error code into a string + * @param code : the error code + * @return the error message + */ const char* grib_get_error_message(int code); const char* grib_get_type_name(int type); int grib_get_native_type(const grib_handle* h, const char* name, int* type); void grib_check(const char* call, const char* file, int line, int e, const char* msg); -#define GRIB_CHECK(a, msg) grib_check(#a, __FILE__, __LINE__, a, msg) +#define GRIB_CHECK(a, msg) grib_check(#a, __FILE__, __LINE__, a, msg) #define GRIB_CHECK_NOLINE(a, msg) grib_check(#a, 0, 0, a, msg) @@ -1404,13 +1404,13 @@ struct grib_points #define GRIB_UTIL_GRID_SPEC_ROTATED_GG 4 #define GRIB_UTIL_GRID_SPEC_REDUCED_GG 5 -#define GRIB_UTIL_GRID_SPEC_SH 6 -#define GRIB_UTIL_GRID_SPEC_REDUCED_LL 7 -#define GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC 8 -#define GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG 9 +#define GRIB_UTIL_GRID_SPEC_SH 6 +#define GRIB_UTIL_GRID_SPEC_REDUCED_LL 7 +#define GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC 8 +#define GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG 9 #define GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA 10 -#define GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL 11 -#define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12 +#define GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL 11 +#define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12 typedef struct grib_util_grid_spec @@ -1462,7 +1462,7 @@ typedef struct grib_util_grid_spec typedef struct grib_util_grid_spec2 { - int grid_type; /* e.g. GRIB_UTIL_GRID_SPEC_REGULAR_LL etc */ + int grid_type; /* e.g. GRIB_UTIL_GRID_SPEC_REGULAR_LL etc */ const char* grid_name; /* e.g. N320 */ /* Grid */ @@ -1493,7 +1493,7 @@ typedef struct grib_util_grid_spec2 /* Bitmap */ long bitmapPresent; - double missingValue; /* 0 means use the default */ + double missingValue; /* 0 means use the default */ /* 'pl' array for reduced Gaussian grids */ const long* pl; @@ -1509,24 +1509,24 @@ typedef struct grib_util_grid_spec2 } grib_util_grid_spec2; -#define GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT 0 -#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX 1 -#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE 2 -#define GRIB_UTIL_PACKING_TYPE_JPEG 3 -#define GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX 4 -#define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE 5 +#define GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT 0 +#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX 1 +#define GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE 2 +#define GRIB_UTIL_PACKING_TYPE_JPEG 3 +#define GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX 4 +#define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE 5 #define GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE_MATRIX 6 -#define GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER 7 -#define GRIB_UTIL_PACKING_TYPE_CCSDS 8 -#define GRIB_UTIL_PACKING_TYPE_IEEE 9 +#define GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER 7 +#define GRIB_UTIL_PACKING_TYPE_CCSDS 8 +#define GRIB_UTIL_PACKING_TYPE_IEEE 9 #define GRIB_UTIL_PACKING_SAME_AS_INPUT 0 -#define GRIB_UTIL_PACKING_USE_PROVIDED 1 +#define GRIB_UTIL_PACKING_USE_PROVIDED 1 -#define GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT 0 -#define GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES 1 +#define GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT 0 +#define GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES 1 #define GRIB_UTIL_ACCURACY_SAME_DECIMAL_SCALE_FACTOR_AS_INPUT 2 -#define GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR 3 +#define GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR 3 typedef struct grib_util_packing_spec { From eb9bcd37b91e28ac40d79ae76d48924258b3629a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Feb 2023 10:44:55 +0000 Subject: [PATCH 085/212] Formatting --- definitions/grib2/products_10.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/grib2/products_10.def b/definitions/grib2/products_10.def index 112d496c9..df1f00e8a 100644 --- a/definitions/grib2/products_10.def +++ b/definitions/grib2/products_10.def @@ -2,6 +2,6 @@ # Copernicus regional reanalysis (CARRA/CERRA) if (!defined(marsExpver)) { -constant marsExpver = 'prod'; + constant marsExpver = 'prod'; } include "grib2/products_crra.def" From a1d55b5b5c590248f8a580e61fa39f01e81b041b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Feb 2023 13:50:06 +0000 Subject: [PATCH 086/212] ECC-1510: Add packingType for template 5.200 --- definitions/grib2/section.5.def | 1 + 1 file changed, 1 insertion(+) diff --git a/definitions/grib2/section.5.def b/definitions/grib2/section.5.def index 3c6c80642..49980cdbe 100644 --- a/definitions/grib2/section.5.def +++ b/definitions/grib2/section.5.def @@ -48,6 +48,7 @@ concept packingType (unknown) { "spectral_ieee" = { dataRepresentationTemplateNumber = 50000; } "grid_simple_log_preprocessing" = { dataRepresentationTemplateNumber = 61; } "bifourier_complex" = { dataRepresentationTemplateNumber = 53; spectralType=2; } + "grid_run_length" = { dataRepresentationTemplateNumber = 200; } } : dump; template dataRepresentation "grib2/template.5.[dataRepresentationTemplateNumber:l].def"; From e85de787cea0284c1c344b4fac94e5b07bc004a6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Feb 2023 14:18:15 +0000 Subject: [PATCH 087/212] ECC-1510: Fix the statistics keys: min, max and average --- definitions/grib2/section.6.def | 4 ++++ src/grib_accessor_class_data_run_length_packing.cc | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/definitions/grib2/section.6.def b/definitions/grib2/section.6.def index b01be8b5b..5de24c487 100644 --- a/definitions/grib2/section.6.def +++ b/definitions/grib2/section.6.def @@ -50,6 +50,10 @@ if (bitMapIndicator == 255) if (dataRepresentationTemplateNumber == 2 || dataRepresentationTemplateNumber == 3) { transient missingValuesPresent = (missingValueManagementUsed != 0) : read_only; } + if (dataRepresentationTemplateNumber == 200) { + # This template can have undefined values within its Data Section + transient missingValuesPresent = 1; + } } meta md5Section6 md5(offsetSection6,section6Length); diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/grib_accessor_class_data_run_length_packing.cc index f5dca1094..46e835716 100644 --- a/src/grib_accessor_class_data_run_length_packing.cc +++ b/src/grib_accessor_class_data_run_length_packing.cc @@ -183,6 +183,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) double level_scale_factor = 0; double* levels = NULL; unsigned char* buf = NULL; + double missingValue = 9999.0; if ((err = grib_get_long_internal(gh, self->seclen, &seclen)) != GRIB_SUCCESS) return err; @@ -196,6 +197,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; + if ((err = grib_get_double(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) + return err; level_values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * number_of_level_values); level_values_size = number_of_level_values; @@ -206,7 +209,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) number_of_compressed_values = ((seclen - 5) * 8) / bits_per_value; if (number_of_compressed_values == 0 || max_level_value == 0) { for (i = 0; i < number_of_values; i++) { - val[i] = GRIB_MISSING_DOUBLE; + val[i] = missingValue; } return GRIB_SUCCESS; } @@ -220,7 +223,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } level_scale_factor = grib_power(-decimal_scale_factor, 10.0); levels = (double*)grib_context_malloc_clear(a->context, sizeof(double) * (number_of_level_values + 1)); - levels[0] = 0; + levels[0] = missingValue; for (i = 0; i < number_of_level_values; i++) { levels[i + 1] = level_values[i] * level_scale_factor; } From 83821a501b06ae849bf120ab6eaf1f904c24c84f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Feb 2023 16:27:33 +0000 Subject: [PATCH 088/212] ECC-1510: Fix numberOfMissing key --- definitions/grib2/template.7.200.def | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/definitions/grib2/template.7.200.def b/definitions/grib2/template.7.200.def index 36116f1e5..c38ae31fc 100644 --- a/definitions/grib2/template.7.200.def +++ b/definitions/grib2/template.7.200.def @@ -24,5 +24,7 @@ meta values data_apply_bitmap(codedValues, alias data.packedValues = codedValues; template statistics "common/statistics_grid.def"; -template missing_values "common/missing_values_grid.def"; +# This template can have undefined values within its Data Section +meta numberOfMissing count_missing(bitmap,unusedBitsInBitmap,numberOfDataPoints,one) : dump; +alias numberOfMissingValues=numberOfMissing; From a950ca130cf1d122e2685c1057bc5b67d088d0bd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Feb 2023 12:22:24 +0000 Subject: [PATCH 089/212] Testing: JasPer issues --- tests/grib_threads_ecc-604.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/grib_threads_ecc-604.sh b/tests/grib_threads_ecc-604.sh index 47c1b5d26..c2d491ffb 100755 --- a/tests/grib_threads_ecc-604.sh +++ b/tests/grib_threads_ecc-604.sh @@ -71,7 +71,8 @@ GRIB2_INPUTS=" ${data_dir}/test_file.grib2 ${data_dir}/sample.grib2" -if [ $HAVE_JPEG -eq 1 ]; then +# There is a problem with multi-threading and Jasper versions > 2 +if [ $HAVE_JPEG -eq 1 -a $HAVE_LIBJASPER -eq 0 ]; then echo "Adding extra files (HAVE_JPEG=1)" GRIB2_INPUTS="${data_dir}/jpeg.grib2 ${data_dir}/reduced_gaussian_surface_jpeg.grib2 "$GRIB2_INPUTS fi From 905277425390a8516a26302c6aa9d4b17f5f06ff Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Feb 2023 16:16:18 +0000 Subject: [PATCH 090/212] Deprecated tools --- tools/{ => deprecated}/load.cc | 0 tools/{ => deprecated}/load.h | 0 tools/{ => deprecated}/loadl.l | 0 tools/{ => deprecated}/loady.y | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tools/{ => deprecated}/load.cc (100%) rename tools/{ => deprecated}/load.h (100%) rename tools/{ => deprecated}/loadl.l (100%) rename tools/{ => deprecated}/loady.y (100%) diff --git a/tools/load.cc b/tools/deprecated/load.cc similarity index 100% rename from tools/load.cc rename to tools/deprecated/load.cc diff --git a/tools/load.h b/tools/deprecated/load.h similarity index 100% rename from tools/load.h rename to tools/deprecated/load.h diff --git a/tools/loadl.l b/tools/deprecated/loadl.l similarity index 100% rename from tools/loadl.l rename to tools/deprecated/loadl.l diff --git a/tools/loady.y b/tools/deprecated/loady.y similarity index 100% rename from tools/loady.y rename to tools/deprecated/loady.y From 36928034112de87459c1b4169515c547b95e8f6c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Feb 2023 16:16:30 +0000 Subject: [PATCH 091/212] Deprecated tools --- tox.ini | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 tox.ini diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 0a6b35b18..000000000 --- a/tox.ini +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore = F403 From c569fedf35df7e55599416b6ab6bb79ee7af7544 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Feb 2023 16:07:24 +0000 Subject: [PATCH 092/212] Add function to check if a date is valid --- src/codes_util.cc | 20 ++++++++++++++++++++ src/eccodes_prototypes.h | 1 + tests/unit_tests.cc | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/src/codes_util.cc b/src/codes_util.cc index 14f966f35..c66f70e0e 100644 --- a/src/codes_util.cc +++ b/src/codes_util.cc @@ -194,3 +194,23 @@ int codes_flush_sync_close_file(FILE* f) } return GRIB_SUCCESS; } + +// Return 1 if input date is valid. Otherwise 0 +int is_date_valid(long year, long month, long day, long hour, long minute, double second) +{ + // Convert input date to Julian number + double result = 0; // Julian number in units of days + long year1, month1, day1, hour1, minute1, lSecond1; + + // For validating the date/time, we specify seconds as an integer + long lSecond = (long)second; + grib_datetime_to_julian(year, month, day, hour, minute, lSecond, &result); + + // Check conversion worked by going other way + grib_julian_to_datetime(result, &year1, &month1, &day1, &hour1, &minute1, &lSecond1); + if (year1 != year || month1 != month || day1 != day || minute1 != minute || lSecond1 != lSecond) { + return 0; // bad date + } + + return 1; +} diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 58aafe2c2..8ce8e2bcb 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1427,6 +1427,7 @@ int path_is_directory(const char* filename); char* codes_getenv(const char* name); int codes_check_grib_ieee_packing_value(int value); int codes_flush_sync_close_file(FILE* f); +int is_date_valid(long year, long month, long day, long hour, long minute, double second); /* grib_util.cc*/ grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err); diff --git a/tests/unit_tests.cc b/tests/unit_tests.cc index 7f910cd71..6672f91d9 100644 --- a/tests/unit_tests.cc +++ b/tests/unit_tests.cc @@ -1654,11 +1654,45 @@ static void test_parse_keyval_string() free( (void*)values3[0].name ); } +static void test_dates() +{ + printf("Testing: dates...\n"); + Assert( is_date_valid(1979,12, 1, 0,0,0) ); + Assert( is_date_valid(1900, 1, 1, 0,0,0) ); + Assert( is_date_valid(1964, 4, 6, 0,0,0) ); + Assert( is_date_valid(2023, 3, 4, 0,0,0) ); + Assert( is_date_valid(2023, 3, 4, 12,0,0) ); + Assert( is_date_valid(2023, 3, 4, 0,10,0) ); + Assert( is_date_valid(2023, 3, 4, 0,0,59) ); + Assert( is_date_valid(0000, 3, 4, 0,0,0) ); + Assert( is_date_valid(2020, 2, 29, 0,0,0) );//leap year + + Assert( !is_date_valid( 10, -1, 1, 0,0,0) );// bad months + Assert( !is_date_valid(1900, 0, 1, 0,0,0) ); + Assert( !is_date_valid(1900, 13, 1, 0,0,0) ); + + Assert( !is_date_valid(1900, 5, 0, 0,0,0) ); // bad days + Assert( !is_date_valid(2000, 5, 32, 0,0,0) ); + Assert( !is_date_valid(2000, 5, -7, 0,0,0) ); + + Assert( !is_date_valid(2000, 5, 8, 99,0,0) );//bad hours + Assert( !is_date_valid(2000, 5, 9, -1,0,0) ); + + Assert( !is_date_valid(2000, 5, 8, 0, 61,0) );//bad mins + Assert( !is_date_valid(2000, 5, 9, 0,-1, 0) ); + + Assert( !is_date_valid(2000, 5, 8, 0, 1, -1) );//bad secs + Assert( !is_date_valid(2000, 5, 9, 0, 1, 60) ); + + Assert( !is_date_valid(2023, 2, 29, 0,0,0) );//Feb + +} int main(int argc, char** argv) { printf("Doing unit tests. ecCodes version = %ld\n", grib_get_api_version()); + test_dates(); test_logging_proc(); test_grib_binary_search(); test_parse_keyval_string(); From f4c4da052a26fa8867e39e80718ad0a33ad5a75c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Feb 2023 17:32:53 +0000 Subject: [PATCH 093/212] grib_util_set_spec: input grid_ccsds gets converted to grid_simple --- src/grib_util.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/grib_util.cc b/src/grib_util.cc index cc16e6090..478e74912 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -982,6 +982,10 @@ grib_handle* grib_util_set_spec2(grib_handle* h, fprintf(stderr, "ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n", input_decimal_scale_factor); } + if (STR_EQUAL(input_packing_type, "grid_ccsds")) { + setCcsdsPacking = 1; + } + /* ECC-1201 TODO: make sure input packing type is preserved */ if (packing_spec->packing == GRIB_UTIL_PACKING_SAME_AS_INPUT && From bc83ac61fcd0a0f9f5238b0e5af21015a1a3bc55 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Feb 2023 18:28:44 +0000 Subject: [PATCH 094/212] grib_util_set_spec: input grid_ccsds gets converted to grid_simple --- src/grib_util.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index 478e74912..1ad1d85ae 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -982,10 +982,6 @@ grib_handle* grib_util_set_spec2(grib_handle* h, fprintf(stderr, "ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n", input_decimal_scale_factor); } - if (STR_EQUAL(input_packing_type, "grid_ccsds")) { - setCcsdsPacking = 1; - } - /* ECC-1201 TODO: make sure input packing type is preserved */ if (packing_spec->packing == GRIB_UTIL_PACKING_SAME_AS_INPUT && @@ -994,6 +990,9 @@ grib_handle* grib_util_set_spec2(grib_handle* h, if (STR_EQUAL(input_packing_type, "grid_ieee")) { SET_STRING_VALUE("packingType", input_packing_type); } + if (STR_EQUAL(input_packing_type, "grid_ccsds")) { + setCcsdsPacking = 1; + } } /*if ( (*err=check_values(data_values, data_values_count))!=GRIB_SUCCESS ) { @@ -1284,7 +1283,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, * Reason 1: It is not available in GRIB1 and so we have to wait until we change edition * Reason 2: It has to be done AFTER we set the data values */ - if (strcmp(input_packing_type, "grid_jpeg") && !strcmp(input_packing_type, "grid_simple")) + if (strcmp(input_packing_type, "grid_jpeg")) setJpegPacking = 1; break; case GRIB_UTIL_PACKING_TYPE_CCSDS: From 1ee583a7c9d4c66e3e4fb3b2a71709eee5b8b0c6 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Feb 2023 18:29:32 +0000 Subject: [PATCH 095/212] grib_util_set_spec: input grid_ccsds gets converted to grid_simple --- tests/grib_util_set_spec.cc | 14 ++++++++++---- tests/grib_util_set_spec.sh | 10 +++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/grib_util_set_spec.cc b/tests/grib_util_set_spec.cc index a2a4b4756..a233c6ea0 100644 --- a/tests/grib_util_set_spec.cc +++ b/tests/grib_util_set_spec.cc @@ -17,11 +17,11 @@ static int get_packing_type_code(const char* packingType) { int result = GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE; if (packingType == NULL) - return result; + return GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT; if (STR_EQUAL(packingType, "grid_jpeg")) result = GRIB_UTIL_PACKING_TYPE_JPEG; - if (STR_EQUAL(packingType, "grid_ccsds")) + else if (STR_EQUAL(packingType, "grid_ccsds")) result = GRIB_UTIL_PACKING_TYPE_CCSDS; else if (STR_EQUAL(packingType, "grid_simple")) result = GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE; @@ -90,7 +90,10 @@ static void test_reduced_gg(int remove_local_def, int edition, const char* packi packing_spec.packing_type = get_packing_type_code(packingType); packing_spec.bitsPerValue = 24; packing_spec.accuracy = GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES; - packing_spec.packing = GRIB_UTIL_PACKING_USE_PROVIDED; + if (packingType) + packing_spec.packing = GRIB_UTIL_PACKING_USE_PROVIDED; + else + packing_spec.packing = GRIB_UTIL_PACKING_SAME_AS_INPUT; /*Extra settings packing_spec.extra_settings_count++; @@ -201,7 +204,10 @@ static void test_regular_ll(int remove_local_def, int edition, const char* packi packing_spec.packing_type = get_packing_type_code(packingType); packing_spec.bitsPerValue = 24; packing_spec.accuracy = GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES; - packing_spec.packing = GRIB_UTIL_PACKING_USE_PROVIDED; + if (packingType) + packing_spec.packing = GRIB_UTIL_PACKING_USE_PROVIDED; + else + packing_spec.packing = GRIB_UTIL_PACKING_SAME_AS_INPUT; packing_spec.extra_settings_count++; packing_spec.extra_settings[0].type = GRIB_TYPE_LONG; diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index b132091ad..1e677b707 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -14,13 +14,21 @@ # -------------------------------------------------- # Regular Lat/Lon Grid # -------------------------------------------------- -infile=../data/latlon.grib +infile=${data_dir}/latlon.grib outfile=out.grib_util_set_spec.grib tempOut=temp.grib_util_set_spec.grib grib_util_set_spec=${test_dir}/grib_util_set_spec rm -f $outfile +# CCSDS input +$EXEC $grib_util_set_spec ${data_dir}/ccsds.grib2 $outfile > /dev/null +grib_check_key_equals $outfile packingType grid_ccsds + +$EXEC $grib_util_set_spec -p grid_simple ${data_dir}/ccsds.grib2 $outfile > /dev/null +grib_check_key_equals $outfile packingType grid_simple + + # GRIB1 with local definition for MARS. Convert to edition2 and remove local def $EXEC $grib_util_set_spec -e 2 -r $infile $outfile > /dev/null From bb68b8bac6c389b50d7951a15564c436a27993a3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Feb 2023 19:42:37 +0000 Subject: [PATCH 096/212] grib_util_set_spec: input grid_ccsds gets converted to grid_simple --- tests/grib_util_set_spec.cc | 69 ++++++++++++++++++++----------------- tests/grib_util_set_spec.sh | 4 +-- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/tests/grib_util_set_spec.cc b/tests/grib_util_set_spec.cc index a233c6ea0..6d65653a1 100644 --- a/tests/grib_util_set_spec.cc +++ b/tests/grib_util_set_spec.cc @@ -20,16 +20,17 @@ static int get_packing_type_code(const char* packingType) return GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT; if (STR_EQUAL(packingType, "grid_jpeg")) - result = GRIB_UTIL_PACKING_TYPE_JPEG; + return GRIB_UTIL_PACKING_TYPE_JPEG; else if (STR_EQUAL(packingType, "grid_ccsds")) - result = GRIB_UTIL_PACKING_TYPE_CCSDS; + return GRIB_UTIL_PACKING_TYPE_CCSDS; else if (STR_EQUAL(packingType, "grid_simple")) - result = GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE; + return GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE; else if (STR_EQUAL(packingType, "grid_second_order")) - result = GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER; + return GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER; else if (STR_EQUAL(packingType, "grid_ieee")) - result = GRIB_UTIL_PACKING_TYPE_IEEE; + return GRIB_UTIL_PACKING_TYPE_IEEE; + Assert(!"Invalid packingType"); return result; } @@ -47,8 +48,8 @@ static void test_reduced_gg(int remove_local_def, int edition, const char* packi const void* buffer = NULL; char gridType[128] = {0,}; - codes_handle* handle = 0; - codes_handle* finalh = 0; + grib_handle* handle = 0; + grib_handle* finalh = 0; grib_util_grid_spec spec = {0,}; grib_util_packing_spec packing_spec = {0,}; @@ -70,6 +71,9 @@ static void test_reduced_gg(int remove_local_def, int edition, const char* packi CODES_CHECK(grib_get_size(handle, "values", &inlen), 0); values = (double*)malloc(sizeof(double) * inlen); CODES_CHECK(grib_get_double_array(handle, "values", values, &inlen), 0); + // make sure values are not constant + values[0] = 4.4; + values[1] = 5.5; for (i = 0; i < inlen; ++i) { values[i] *= 1.10; } @@ -115,7 +119,7 @@ static void test_reduced_gg(int remove_local_def, int edition, const char* packi /* Try some invalid inputs and check it is handled */ { - codes_handle* h2 = 0; + grib_handle* h2 = 0; packing_spec.accuracy = 999; h2 = grib_util_set_spec(handle, &spec, &packing_spec, set_spec_flags, values, outlen, &err); Assert(err == GRIB_INTERNAL_ERROR); @@ -161,18 +165,18 @@ static void test_regular_ll(int remove_local_def, int edition, const char* packi char gridType[128] = {0,}; long input_edition = 0; - codes_handle* handle = 0; - codes_handle* finalh = 0; + grib_handle* handle = 0; + grib_handle* finalh = 0; grib_util_grid_spec spec = {0,}; grib_util_packing_spec packing_spec = {0,}; Assert(input_filename); in = fopen(input_filename, "rb"); Assert(in); - handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); + handle = grib_handle_new_from_file(0, in, &err); Assert(handle); - CODES_CHECK(codes_get_long(handle, "edition", &input_edition), 0); + CODES_CHECK(grib_get_long(handle, "edition", &input_edition), 0); CODES_CHECK(grib_get_string(handle, "gridType", gridType, &slen), 0); if (!STR_EQUAL(gridType, "regular_ll")) { @@ -183,9 +187,12 @@ static void test_regular_ll(int remove_local_def, int edition, const char* packi out = fopen(output_filename, "wb"); Assert(out); - CODES_CHECK(codes_get_size(handle, "values", &inlen), 0); + CODES_CHECK(grib_get_size(handle, "values", &inlen), 0); values = (double*)malloc(sizeof(double) * inlen); - CODES_CHECK(codes_get_double_array(handle, "values", values, &inlen), 0); + CODES_CHECK(grib_get_double_array(handle, "values", values, &inlen), 0); + // make sure values are not constant + values[0] = 4.4; + values[1] = 5.5; spec.grid_type = GRIB_UTIL_GRID_SPEC_REGULAR_LL; spec.Nj = 14; @@ -221,7 +228,7 @@ static void test_regular_ll(int remove_local_def, int edition, const char* packi packing_spec.deleteLocalDefinition = 1; } - finalh = codes_grib_util_set_spec( + finalh = grib_util_set_spec( handle, &spec, &packing_spec, @@ -238,19 +245,19 @@ static void test_regular_ll(int remove_local_def, int edition, const char* packi if (input_edition == 1) { const double expected_lat1 = 60.001; double lat1 = 0; - CODES_CHECK(codes_get_double(finalh, "latitudeOfFirstGridPointInDegrees", &lat1), 0); + CODES_CHECK(grib_get_double(finalh, "latitudeOfFirstGridPointInDegrees", &lat1), 0); Assert(fabs(lat1 - expected_lat1) < 1e-10); } /* Write out the message to the output file */ - CODES_CHECK(codes_get_message(finalh, &buffer, &size), 0); + CODES_CHECK(grib_get_message(finalh, &buffer, &size), 0); CODES_CHECK(codes_check_message_header(buffer, size, PRODUCT_GRIB), 0); CODES_CHECK(codes_check_message_footer(buffer, size, PRODUCT_GRIB), 0); if (fwrite(buffer, 1, size, out) != size) { Assert(0); } - codes_handle_delete(handle); - codes_handle_delete(finalh); + grib_handle_delete(handle); + grib_handle_delete(finalh); free(values); fclose(in); fclose(out); @@ -272,13 +279,13 @@ static void test_grid_complex_spatial_differencing(int remove_local_def, int edi char gridType[128] = {0,}; double theMax,theMin,theAverage; - codes_handle *handle = 0; - codes_handle *finalh = 0; + grib_handle *handle = 0; + grib_handle *finalh = 0; grib_util_grid_spec spec={0,}; grib_util_packing_spec packing_spec={0,}; in = fopen(input_filename,"rb"); Assert(in); - handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); Assert(handle); + handle = grib_handle_new_from_file(0, in, &err); Assert(handle); CODES_CHECK(grib_get_string(handle, "packingType", gridType, &slen),0); if (!STR_EQUAL(gridType, "grid_complex_spatial_differencing")) { @@ -287,13 +294,13 @@ static void test_grid_complex_spatial_differencing(int remove_local_def, int edi } out = fopen(output_filename,"wb"); Assert(out); - CODES_CHECK(codes_get_size(handle,"values",&inlen), 0); + CODES_CHECK(grib_get_size(handle,"values",&inlen), 0); values = (double*)malloc(sizeof(double)*inlen); - CODES_CHECK(codes_get_double_array(handle, "values", values,&inlen), 0); + CODES_CHECK(grib_get_double_array(handle, "values", values,&inlen), 0); - CODES_CHECK(codes_get_double(handle, "max", &theMax),0); - CODES_CHECK(codes_get_double(handle, "min", &theMin),0); - CODES_CHECK(codes_get_double(handle, "average",&theAverage),0); + CODES_CHECK(grib_get_double(handle, "max", &theMax),0); + CODES_CHECK(grib_get_double(handle, "min", &theMin),0); + CODES_CHECK(grib_get_double(handle, "average",&theAverage),0); printf("inlen=%lu \t max=%g \t min=%g \t avg=%g\n", inlen, theMax, theMin, theAverage); spec.grid_type = GRIB_UTIL_GRID_SPEC_REGULAR_LL; @@ -321,7 +328,7 @@ static void test_grid_complex_spatial_differencing(int remove_local_def, int edi packing_spec.deleteLocalDefinition = 1; } - finalh = codes_grib_util_set_spec( + finalh = grib_util_set_spec( handle, &spec, &packing_spec, @@ -333,12 +340,12 @@ static void test_grid_complex_spatial_differencing(int remove_local_def, int edi Assert(err == 0); /* Write out the message to the output file */ - CODES_CHECK(codes_get_message(finalh, &buffer, &size),0); + CODES_CHECK(grib_get_message(finalh, &buffer, &size),0); if(fwrite(buffer,1,size,out) != size) { Assert(0); } - codes_handle_delete(handle); - codes_handle_delete(finalh); + grib_handle_delete(handle); + grib_handle_delete(finalh); fclose(in); fclose(out); } diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index 1e677b707..c604d5f1e 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -92,7 +92,7 @@ $EXEC $grib_util_set_spec -p grid_second_order $infile $outfile # Check output file. Values are scaled up by 1.1 grib_check_key_equals $outfile packingType grid_second_order stats_new=`${tools_dir}/grib_get -F%.2f -p min,max $outfile` -[ "$stats_new" = "176.28 246.90" ] +[ "$stats_new" = "4.84 246.90" ] ${tools_dir}/grib_get_data $outfile > /dev/null CHECK_TOOL="${tools_dir}/grib_check_gaussian_grid" @@ -106,7 +106,7 @@ infile=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl rm -f $outfile $EXEC $grib_util_set_spec $infile $outfile -grib_check_key_equals $outfile "packingType,const" "grid_simple 1" +grib_check_key_equals $outfile "packingType,const" "grid_simple 0" ${tools_dir}/grib_get_data $outfile > /dev/null From 9b97ad306671ab2cffb74ccfebe1ca5bb8c1ae16 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Feb 2023 19:47:03 +0000 Subject: [PATCH 097/212] grib_util_set_spec: tests --- tests/grib_util_set_spec.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index c604d5f1e..c89543a57 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -21,14 +21,6 @@ grib_util_set_spec=${test_dir}/grib_util_set_spec rm -f $outfile -# CCSDS input -$EXEC $grib_util_set_spec ${data_dir}/ccsds.grib2 $outfile > /dev/null -grib_check_key_equals $outfile packingType grid_ccsds - -$EXEC $grib_util_set_spec -p grid_simple ${data_dir}/ccsds.grib2 $outfile > /dev/null -grib_check_key_equals $outfile packingType grid_simple - - # GRIB1 with local definition for MARS. Convert to edition2 and remove local def $EXEC $grib_util_set_spec -e 2 -r $infile $outfile > /dev/null @@ -101,7 +93,7 @@ if [ -x $CHECK_TOOL ]; then fi ### Constant field N=32 -########################################### +# --------------------------- infile=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl rm -f $outfile @@ -110,6 +102,19 @@ grib_check_key_equals $outfile "packingType,const" "grid_simple 0" ${tools_dir}/grib_get_data $outfile > /dev/null +# CCSDS input +# --------------------------- +infile=${data_dir}/ccsds.grib2 +$EXEC $grib_util_set_spec $infile $outfile +grib_check_key_equals $outfile packingType grid_ccsds + +$EXEC $grib_util_set_spec -p grid_simple $infile $outfile +grib_check_key_equals $outfile packingType grid_simple + +$EXEC $grib_util_set_spec -p grid_second_order $infile $outfile +grib_check_key_equals $outfile packingType grid_second_order + + ### Clean up rm -f $outfile $tempOut rm -f error.data From 1db0f4fc6f137c16bcb665ea0758ca1cca807b46 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 Feb 2023 13:50:44 +0000 Subject: [PATCH 098/212] ECC-1530: grib_util_set_spec: Input packing type of grid_second_order changed to grid_simple --- src/grib_util.cc | 7 +++++-- tests/grib_util_set_spec.sh | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index 1ad1d85ae..3d61470ea 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -982,8 +982,8 @@ grib_handle* grib_util_set_spec2(grib_handle* h, fprintf(stderr, "ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n", input_decimal_scale_factor); } - /* ECC-1201 - TODO: make sure input packing type is preserved */ + /* ECC-1201, ECC-1529, ECC-1530 + Make sure input packing type is preserved */ if (packing_spec->packing == GRIB_UTIL_PACKING_SAME_AS_INPUT && packing_spec->packing_type == GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT) { @@ -993,6 +993,9 @@ grib_handle* grib_util_set_spec2(grib_handle* h, if (STR_EQUAL(input_packing_type, "grid_ccsds")) { setCcsdsPacking = 1; } + if (STR_EQUAL(input_packing_type, "grid_second_order")) { + setSecondOrder = 1; + } } /*if ( (*err=check_values(data_values, data_values_count))!=GRIB_SUCCESS ) { diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index c89543a57..f00db6a9a 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -104,16 +104,24 @@ ${tools_dir}/grib_get_data $outfile > /dev/null # CCSDS input # --------------------------- -infile=${data_dir}/ccsds.grib2 -$EXEC $grib_util_set_spec $infile $outfile -grib_check_key_equals $outfile packingType grid_ccsds +if [ $HAVE_AEC -eq 1 ]; then + infile=${data_dir}/ccsds.grib2 + $EXEC $grib_util_set_spec $infile $outfile + grib_check_key_equals $outfile packingType grid_ccsds -$EXEC $grib_util_set_spec -p grid_simple $infile $outfile -grib_check_key_equals $outfile packingType grid_simple + $EXEC $grib_util_set_spec -p grid_simple $infile $outfile + grib_check_key_equals $outfile packingType grid_simple -$EXEC $grib_util_set_spec -p grid_second_order $infile $outfile -grib_check_key_equals $outfile packingType grid_second_order + $EXEC $grib_util_set_spec -p grid_second_order $infile $outfile + grib_check_key_equals $outfile packingType grid_second_order +fi +# Second order input +# --------------------------- +${tools_dir}/grib_set -r -s packingType=grid_second_order ${data_dir}/sample.grib2 $tempOut +grib_check_key_equals $tempOut packingType grid_second_order +$EXEC $grib_util_set_spec $tempOut $outfile +grib_check_key_equals $outfile packingType grid_second_order ### Clean up rm -f $outfile $tempOut From 2432c1d02977c98063088d710f7b309825562363 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 Feb 2023 15:44:46 +0000 Subject: [PATCH 099/212] Remove duplicated macro --- src/codes_util.cc | 38 +++++++++++++++---------------- src/grib_api_internal.h | 2 +- src/grib_util.cc | 2 -- tests/grib_util_set_spec.cc | 2 -- tests/unit_tests.cc | 15 ++++++------ tools/grib_check_gaussian_grid.cc | 1 - 6 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/codes_util.cc b/src/codes_util.cc index c66f70e0e..b5c5ddd57 100644 --- a/src/codes_util.cc +++ b/src/codes_util.cc @@ -86,44 +86,44 @@ char* codes_getenv(const char* name) const char* old_name = name; /* Test the most commonly used variables first */ - if (STR_EQ(name, "ECCODES_SAMPLES_PATH")) + if (STR_EQUAL(name, "ECCODES_SAMPLES_PATH")) old_name = "GRIB_SAMPLES_PATH"; - else if (STR_EQ(name, "ECCODES_DEFINITION_PATH")) + else if (STR_EQUAL(name, "ECCODES_DEFINITION_PATH")) old_name = "GRIB_DEFINITION_PATH"; - else if (STR_EQ(name, "ECCODES_DEBUG")) + else if (STR_EQUAL(name, "ECCODES_DEBUG")) old_name = "GRIB_API_DEBUG"; - else if (STR_EQ(name, "ECCODES_FAIL_IF_LOG_MESSAGE")) + else if (STR_EQUAL(name, "ECCODES_FAIL_IF_LOG_MESSAGE")) old_name = "GRIB_API_FAIL_IF_LOG_MESSAGE"; - else if (STR_EQ(name, "ECCODES_GRIB_WRITE_ON_FAIL")) + else if (STR_EQUAL(name, "ECCODES_GRIB_WRITE_ON_FAIL")) old_name = "GRIB_API_WRITE_ON_FAIL"; - else if (STR_EQ(name, "ECCODES_GRIB_LARGE_CONSTANT_FIELDS")) + else if (STR_EQUAL(name, "ECCODES_GRIB_LARGE_CONSTANT_FIELDS")) old_name = "GRIB_API_LARGE_CONSTANT_FIELDS"; - else if (STR_EQ(name, "ECCODES_NO_ABORT")) + else if (STR_EQUAL(name, "ECCODES_NO_ABORT")) old_name = "GRIB_API_NO_ABORT"; - else if (STR_EQ(name, "ECCODES_GRIBEX_MODE_ON")) + else if (STR_EQUAL(name, "ECCODES_GRIBEX_MODE_ON")) old_name = "GRIB_GRIBEX_MODE_ON"; - else if (STR_EQ(name, "ECCODES_GRIB_IEEE_PACKING")) + else if (STR_EQUAL(name, "ECCODES_GRIB_IEEE_PACKING")) old_name = "GRIB_IEEE_PACKING"; - else if (STR_EQ(name, "ECCODES_IO_BUFFER_SIZE")) + else if (STR_EQUAL(name, "ECCODES_IO_BUFFER_SIZE")) old_name = "GRIB_API_IO_BUFFER_SIZE"; - else if (STR_EQ(name, "ECCODES_LOG_STREAM")) + else if (STR_EQUAL(name, "ECCODES_LOG_STREAM")) old_name = "GRIB_API_LOG_STREAM"; - else if (STR_EQ(name, "ECCODES_GRIB_NO_BIG_GROUP_SPLIT")) + else if (STR_EQUAL(name, "ECCODES_GRIB_NO_BIG_GROUP_SPLIT")) old_name = "GRIB_API_NO_BIG_GROUP_SPLIT"; - else if (STR_EQ(name, "ECCODES_GRIB_NO_SPD")) + else if (STR_EQUAL(name, "ECCODES_GRIB_NO_SPD")) old_name = "GRIB_API_NO_SPD"; - else if (STR_EQ(name, "ECCODES_GRIB_KEEP_MATRIX")) + else if (STR_EQUAL(name, "ECCODES_GRIB_KEEP_MATRIX")) old_name = "GRIB_API_KEEP_MATRIX"; - else if (STR_EQ(name, "_ECCODES_ECMWF_TEST_DEFINITION_PATH")) + else if (STR_EQUAL(name, "_ECCODES_ECMWF_TEST_DEFINITION_PATH")) old_name = "_GRIB_API_ECMWF_TEST_DEFINITION_PATH"; - else if (STR_EQ(name, "_ECCODES_ECMWF_TEST_SAMPLES_PATH")) + else if (STR_EQUAL(name, "_ECCODES_ECMWF_TEST_SAMPLES_PATH")) old_name = "_GRIB_API_ECMWF_TEST_SAMPLES_PATH"; - else if (STR_EQ(name, "ECCODES_GRIB_JPEG")) + else if (STR_EQUAL(name, "ECCODES_GRIB_JPEG")) old_name = "GRIB_JPEG"; - else if (STR_EQ(name, "ECCODES_GRIB_DUMP_JPG_FILE")) + else if (STR_EQUAL(name, "ECCODES_GRIB_DUMP_JPG_FILE")) old_name = "GRIB_DUMP_JPG_FILE"; - else if (STR_EQ(name, "ECCODES_PRINT_MISSING")) + else if (STR_EQUAL(name, "ECCODES_PRINT_MISSING")) old_name = "GRIB_PRINT_MISSING"; result = getenv(old_name); diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 269c2a42a..eeb18e816 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -201,7 +201,7 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type); #endif /* Return true if two strings are equal */ -#define STR_EQ(a, b) (strcmp((a), (b)) == 0) +#define STR_EQUAL(a, b) (strcmp((a), (b)) == 0) #include "grib_api.h" diff --git a/src/grib_util.cc b/src/grib_util.cc index 3d61470ea..b5e45c858 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -11,8 +11,6 @@ #include "grib_api_internal.h" #include -#define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) - typedef enum { eROUND_ANGLE_UP, diff --git a/tests/grib_util_set_spec.cc b/tests/grib_util_set_spec.cc index 6d65653a1..cf254aff4 100644 --- a/tests/grib_util_set_spec.cc +++ b/tests/grib_util_set_spec.cc @@ -11,8 +11,6 @@ #include "grib_api_internal.h" #include "eccodes.h" -#define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) - static int get_packing_type_code(const char* packingType) { int result = GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE; diff --git a/tests/unit_tests.cc b/tests/unit_tests.cc index 6672f91d9..505a2a78f 100644 --- a/tests/unit_tests.cc +++ b/tests/unit_tests.cc @@ -10,7 +10,6 @@ #include "grib_api_internal.h" -#define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) #define NUMBER(x) (sizeof(x) / sizeof(x[0])) int assertion_caught = 0; @@ -1404,10 +1403,10 @@ static void test_string_splitting() if (!list) { Assert(!"List is NULL"); return; } for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ Assert(i == 4); - if (!list[0] || !STR_EQ(list[0], "Born")) Assert(0); - if (!list[1] || !STR_EQ(list[1], "To")) Assert(0); - if (!list[2] || !STR_EQ(list[2], "Be")) Assert(0); - if (!list[3] || !STR_EQ(list[3], "Wild")) Assert(0); + if (!list[0] || !STR_EQUAL(list[0], "Born")) Assert(0); + if (!list[1] || !STR_EQUAL(list[1], "To")) Assert(0); + if (!list[2] || !STR_EQUAL(list[2], "Be")) Assert(0); + if (!list[3] || !STR_EQUAL(list[3], "Wild")) Assert(0); Assert(list[4] == NULL); for (i = 0; list[i] != NULL; ++i) free(list[i]); free(list); @@ -1417,8 +1416,8 @@ static void test_string_splitting() if (!list) { Assert(0); return; } for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ Assert(i == 2); - if (!list[0] || !STR_EQ(list[0], "12345")) Assert(0); - if (!list[1] || !STR_EQ(list[1], "a gap")) Assert(0); + if (!list[0] || !STR_EQUAL(list[0], "12345")) Assert(0); + if (!list[1] || !STR_EQUAL(list[1], "a gap")) Assert(0); Assert(list[2] == NULL); for (i = 0; list[i] != NULL; ++i) free(list[i]); free(list); @@ -1428,7 +1427,7 @@ static void test_string_splitting() if (!list) { Assert(0); return; } for (i = 0; list[i] != NULL; ++i) {} /* count how many tokens */ Assert(i == 1); - if (!list[0] || !STR_EQ(list[0], "Steppenwolf")) Assert(0); + if (!list[0] || !STR_EQUAL(list[0], "Steppenwolf")) Assert(0); Assert(list[1] == NULL); for (i = 0; list[i] != NULL; ++i) free(list[i]); free(list); diff --git a/tools/grib_check_gaussian_grid.cc b/tools/grib_check_gaussian_grid.cc index 0a26cea96..c3180903d 100644 --- a/tools/grib_check_gaussian_grid.cc +++ b/tools/grib_check_gaussian_grid.cc @@ -22,7 +22,6 @@ #include "grib_api_internal.h" -#define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) int exit_on_error = 1; /* By default exit if any check fails */ int verbose = 0; /* By default quiet unless errors */ From d6ab079a420df2bb37e73be74416d9ac69e9bc82 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 17 Feb 2023 17:08:50 +0000 Subject: [PATCH 100/212] Tools: Preparation for ECC-1528 --- tools/grib_tools.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index 83d5c4b30..af8d71f0a 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -799,7 +799,7 @@ static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle } } -static int to_skip(grib_handle* h, grib_values* v, int* err) +static int to_skip(grib_runtime_options* options, grib_handle* h, grib_values* v, int* err) { double dvalue = 0; int ret = 0; @@ -808,6 +808,8 @@ static int to_skip(grib_handle* h, grib_values* v, int* err) size_t len = MAX_STRING_LEN; *err = 0; + Assert(options->constraints_count > 0); + if (strcmp(v->name, "count")==0 && v->long_value < 1) { fprintf(dump_file, "ERROR: Invalid value for key '%s' (must be an integer greater than 0)\n", v->name); exit(1); @@ -858,7 +860,7 @@ void grib_skip_check(grib_runtime_options* options, grib_handle* h) if (v->equal) { options->skip = 1; while (v) { - if (!to_skip(h, v, &ret)) { + if (!to_skip(options, h, v, &ret)) { if (!strcmp(v->name, "count") && !v->next) { /* We have count=XX and nothing after that so we can * skip every other message after it @@ -879,7 +881,7 @@ void grib_skip_check(grib_runtime_options* options, grib_handle* h) else { options->skip = 0; while (v) { - if (to_skip(h, v, &ret)) { + if (to_skip(options, h, v, &ret)) { options->skip = 1; break; } From eeefee650c3d9265ee248bf18ac01923b781c6ce Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Feb 2023 15:52:11 +0000 Subject: [PATCH 101/212] grib_util_set_spec: tests --- tests/grib_util_set_spec.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index f00db6a9a..0a64538ac 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -14,7 +14,7 @@ # -------------------------------------------------- # Regular Lat/Lon Grid # -------------------------------------------------- -infile=${data_dir}/latlon.grib +infile=${data_dir}/latlon.grib # edition 1 outfile=out.grib_util_set_spec.grib tempOut=temp.grib_util_set_spec.grib grib_util_set_spec=${test_dir}/grib_util_set_spec @@ -42,7 +42,7 @@ res=`${tools_dir}/grib_get -p edition,section2Used $outfile` [ "$res" = "2 0" ] # GRIB2 input with local definition -infile=../data/regular_latlon_surface.grib2 +infile=${data_dir}/regular_latlon_surface.grib2 $EXEC $grib_util_set_spec -r $infile $outfile > /dev/null grib_check_key_equals $outfile section2Used 0 # GRIB2 input without local definition @@ -52,18 +52,26 @@ grib_check_key_equals $outfile section2Used 0 # Convert to edition2 and use JPEG for packing if [ $HAVE_JPEG -eq 1 ]; then - infile=../data/latlon.grib + infile=${data_dir}/latlon.grib $EXEC $grib_util_set_spec -e 2 -p grid_jpeg $infile $outfile > /dev/null res=`${tools_dir}/grib_get -p edition,section2Used,packingType $outfile` [ "$res" = "2 1 grid_jpeg" ] fi -# Convert to edition2 and use CCSDS for packing +# CCSDS for packing and different editions if [ $HAVE_AEC -eq 1 ]; then - infile=../data/latlon.grib + infile=${data_dir}/sample.grib2 + $EXEC $grib_util_set_spec -p grid_ccsds $infile $outfile + grib_check_key_equals $outfile packingType grid_ccsds + + infile=${data_dir}/latlon.grib #grib1 $EXEC $grib_util_set_spec -e 2 -p grid_ccsds $infile $outfile > /dev/null res=`${tools_dir}/grib_get -p edition,section2Used,packingType $outfile` [ "$res" = "2 1 grid_ccsds" ] + + # If we don't convert, then should leave it as grid_simple (No CCSDS in grib1) + $EXEC $grib_util_set_spec -p grid_ccsds $infile $outfile + grib_check_key_equals $outfile packingType grid_simple fi # -------------------------------------------------- @@ -72,7 +80,7 @@ fi # The gaussian tests intentionally cause an error so need to stop it failing unset ECCODES_FAIL_IF_LOG_MESSAGE -infile=../data/reduced_gaussian_model_level.grib2 +infile=${data_dir}/reduced_gaussian_model_level.grib2 outfile=out.grib_util_set_spec.grib rm -f $outfile From 50fa34c22fedfc72a84d7e1f8b16bd8aa541c5b9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 19 Feb 2023 14:30:40 +0000 Subject: [PATCH 102/212] ECC-1531: Detect old versions of libaec --- src/grib_accessor_class_data_ccsds_packing.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 370053fed..28074c5d2 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -191,6 +191,10 @@ static int value_count(grib_accessor* a, long* count) #include +#ifndef LIBAEC_DLL_EXPORTED + #error Version of libaec appears to be too old. Please upgrade. +#endif + static const char* aec_get_error_message(int code) { if (code == AEC_MEM_ERROR) return "AEC_MEM_ERROR"; From e9d4628e781f68893abc7e67bc851d14ccb33903 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 19 Feb 2023 14:57:19 +0000 Subject: [PATCH 103/212] grib_util_set_spec: tests --- tests/grib_util_set_spec.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index 0a64538ac..319fc28d7 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -131,6 +131,14 @@ grib_check_key_equals $tempOut packingType grid_second_order $EXEC $grib_util_set_spec $tempOut $outfile grib_check_key_equals $outfile packingType grid_second_order + +# Check DEBUG output +# --------------------------- +export ECCODES_DEBUG=-1 +$EXEC $grib_util_set_spec ${data_dir}/sample.grib2 $outfile > $tempOut 2>&1 +grep -q "ECCODES DEBUG grib_util:" $tempOut + + ### Clean up rm -f $outfile $tempOut rm -f error.data From a19d5258a1e9a925c2bcd8c55728d4e4211f1a9c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 19 Feb 2023 16:15:27 +0000 Subject: [PATCH 104/212] grib_util_set_spec: tests --- tests/grib_util_set_spec.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index 319fc28d7..3daf5d0db 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -124,13 +124,16 @@ if [ $HAVE_AEC -eq 1 ]; then grib_check_key_equals $outfile packingType grid_second_order fi -# Second order input +# Second order input/output # --------------------------- ${tools_dir}/grib_set -r -s packingType=grid_second_order ${data_dir}/sample.grib2 $tempOut grib_check_key_equals $tempOut packingType grid_second_order $EXEC $grib_util_set_spec $tempOut $outfile grib_check_key_equals $outfile packingType grid_second_order +$EXEC $grib_util_set_spec -p grid_second_order ${data_dir}/simple.grib $outfile +grib_check_key_equals $outfile packingType grid_second_order + # Check DEBUG output # --------------------------- From 687e3f4cf6ea8430ec3ce419b75bd3bdb48a9588 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 20 Feb 2023 08:41:32 +0000 Subject: [PATCH 105/212] ECC-1467: Single-precision implementation with the use of templates --- src/eccodes_prototypes.h | 11 +- src/grib_accessor_class_bitmap.cc | 61 +-- src/grib_accessor_class_bitmap.h | 39 ++ src/grib_accessor_class_data_apply_bitmap.cc | 181 +------ src/grib_accessor_class_data_apply_bitmap.h | 109 ++++ src/grib_accessor_class_data_ccsds_packing.cc | 271 +--------- src/grib_accessor_class_data_ccsds_packing.h | 160 ++++++ ...rib_accessor_class_data_complex_packing.cc | 480 +----------------- ...grib_accessor_class_data_complex_packing.h | 269 ++++++++++ src/grib_accessor_class_data_raw_packing.cc | 4 +- ...grib_accessor_class_data_simple_packing.cc | 8 +- src/grib_accessor_class_gen.cc | 68 +-- src/grib_accessor_class_gen.h | 53 ++ src/grib_api_internal.h | 8 +- src/grib_api_internal_cpp.h | 5 + src/grib_bits.cc | 2 +- src/grib_bits_any_endian_simple.cc | 261 ++++------ src/grib_bits_any_endian_simple.h | 97 ++++ src/grib_ieeefloat.cc | 8 +- src/grib_ieeefloat.h | 5 + src/grib_value.cc | 72 +-- src/grib_value.h | 24 + 22 files changed, 943 insertions(+), 1253 deletions(-) create mode 100644 src/grib_accessor_class_bitmap.h create mode 100644 src/grib_accessor_class_data_apply_bitmap.h create mode 100644 src/grib_accessor_class_data_ccsds_packing.h create mode 100644 src/grib_accessor_class_data_complex_packing.h create mode 100644 src/grib_accessor_class_gen.h create mode 100644 src/grib_api_internal_cpp.h create mode 100644 src/grib_bits_any_endian_simple.h create mode 100644 src/grib_ieeefloat.h create mode 100644 src/grib_value.h diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 5ebe0ba33..05c2af1a7 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1,3 +1,5 @@ +#pragma once + #ifdef ECCODES_ON_WINDOWS #include #endif @@ -836,8 +838,9 @@ int grib_nearest_smaller_ieee_float(double a, double* ret); unsigned long grib_ieee64_to_long(double x); double grib_long_to_ieee64(unsigned long x); -int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val); -int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val); +// ECC-1467 +//int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val); +//int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val); int grib_ieee_encode_array(grib_context* c, double* val, size_t nvals, int bytes, unsigned char* buf); /* grib_accessor_class_reference_value_error.cc*/ @@ -1548,8 +1551,8 @@ int grib_encode_size_tb(unsigned char* p, size_t val, long* bitp, long nb); /* grib_bits_any_endian_simple.cc*/ int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue, size_t n_vals, long* val); -int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, double* val); -int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, float* val); +//int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, double* val); +//int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, double reference_value, double s, double d, size_t n_vals, float* val); int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val); int grib_encode_long_array(size_t n_vals, const long* val, long bits_per_value, unsigned char* p, long* off); int grib_encode_double_array(size_t n_vals, const double* val, long bits_per_value, double reference_value, double d, double divisor, unsigned char* p, long* off); diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc index 3bcbc04c3..773897401 100644 --- a/src/grib_accessor_class_bitmap.cc +++ b/src/grib_accessor_class_bitmap.cc @@ -8,7 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" +#include "grib_accessor_class_bitmap.h" /* This is used by make_class.pl @@ -40,8 +40,8 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_float(grib_accessor*, float* val, size_t* len); +//static int unpack_double(grib_accessor*, double* val, size_t* len); +//static int unpack_float(grib_accessor*, float* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static long next_offset(grib_accessor*); @@ -89,8 +89,8 @@ static grib_accessor_class _grib_accessor_class_bitmap = { &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &unpack_double, /* grib_unpack procedures double */ - &unpack_float, /* grib_unpack procedures float */ + &GribAccessorClassBitmap::unpack, /* grib_unpack procedures double */ + &GribAccessorClassBitmap::unpack, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -247,57 +247,6 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - long pos = a->offset * 8; - long tlen; - long i; - int err = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - err = grib_value_count(a, &tlen); - if (err) - return err; - - if (*len < tlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < tlen; i++) { - val[i] = (double)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); - } - *len = tlen; - return GRIB_SUCCESS; -} - -// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ - long pos = a->offset * 8; - long tlen; - long i; - int err = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - err = grib_value_count(a, &tlen); - if (err) - return err; - - if (*len < tlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < tlen; i++) { - val[i] = (float)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); - } - *len = tlen; - return GRIB_SUCCESS; -} -// static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { long pos = a->offset * 8; diff --git a/src/grib_accessor_class_bitmap.h b/src/grib_accessor_class_bitmap.h new file mode 100644 index 000000000..f1ea63c6a --- /dev/null +++ b/src/grib_accessor_class_bitmap.h @@ -0,0 +1,39 @@ +// ECC-1467 + +#pragma once + +#include "grib_api_internal_cpp.h" +#include + +template +class GribAccessorClassBitmap { +public: + static int unpack(grib_accessor* a, T* val, size_t* len); +}; + +template +int GribAccessorClassBitmap::unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating points numbers"); + long pos = a->offset * 8; + long tlen; + long i; + int err = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + err = grib_value_count(a, &tlen); + if (err) + return err; + + if (*len < tlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < tlen; i++) { + val[i] = (T)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); + } + *len = tlen; + return GRIB_SUCCESS; +} diff --git a/src/grib_accessor_class_data_apply_bitmap.cc b/src/grib_accessor_class_data_apply_bitmap.cc index 13c770b7c..9f8881399 100644 --- a/src/grib_accessor_class_data_apply_bitmap.cc +++ b/src/grib_accessor_class_data_apply_bitmap.cc @@ -9,6 +9,7 @@ */ #include "grib_api_internal.h" +#include "grib_accessor_class_data_apply_bitmap.h" /* This is used by make_class.pl @@ -43,8 +44,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int get_native_type(grib_accessor*); static int pack_double(grib_accessor*, const double* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); @@ -52,18 +51,6 @@ static void init_class(grib_accessor_class*); static int unpack_double_element(grib_accessor*, size_t i, double* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); -typedef struct grib_accessor_data_apply_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_apply_bitmap */ - const char* coded_values; - const char* bitmap; - const char* missing_value; - const char* number_of_data_points; - const char* number_of_values; - const char* binary_scale_factor; -} grib_accessor_data_apply_bitmap; extern grib_accessor_class* grib_accessor_class_gen; @@ -90,8 +77,8 @@ static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &unpack_double, /* grib_unpack procedures double */ - &unpack_float, /* grib_unpack procedures float */ + &GribAccessorDataApplyBitmap::unpack, /* grib_unpack procedures double */ + &GribAccessorDataApplyBitmap::unpack, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -189,168 +176,6 @@ static int value_count(grib_accessor* a, long* count) return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - - size_t i = 0; - size_t j = 0; - size_t n_vals = 0; - long nn = 0; - int err = 0; - size_t coded_n_vals = 0; - double* coded_vals = NULL; - double missing_value = 0; - - err = grib_value_count(a, &nn); - n_vals = nn; - if (err) - return err; - - if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) - return grib_get_double_array(grib_handle_of_accessor(a), self->coded_values, val, len); - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if (coded_n_vals == 0) { - for (i = 0; i < n_vals; i++) - val[i] = missing_value; - - *len = n_vals; - return GRIB_SUCCESS; - } - - if ((err = grib_get_double_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) - return err; - - coded_vals = (double*)grib_context_malloc(a->context, coded_n_vals * sizeof(double)); - if (coded_vals == NULL) - return GRIB_OUT_OF_MEMORY; - - if ((err = grib_get_double_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { - grib_context_free(a->context, coded_vals); - return err; - } - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_apply_bitmap: unpack_double : creating %s, %d values", - a->name, n_vals); - - for (i = 0; i < n_vals; i++) { - if (val[i] == 0) { - val[i] = missing_value; - } - else { - val[i] = coded_vals[j++]; - if (j > coded_n_vals) { - grib_context_free(a->context, coded_vals); - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_apply_bitmap [%s]:" - " unpack_double : number of coded values does not match bitmap %ld %ld", - a->name, coded_n_vals, n_vals); - - return GRIB_ARRAY_TOO_SMALL; - } - } - } - - *len = n_vals; - - grib_context_free(a->context, coded_vals); - return err; -} - -// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! -// Should be merged with unpack_double and refactored! Most probably using C++ templates -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - - size_t i = 0; - size_t j = 0; - size_t n_vals = 0; - long nn = 0; - int err = 0; - size_t coded_n_vals = 0; - float* coded_vals = NULL; - double missing_value = 0; - - err = grib_value_count(a, &nn); - n_vals = nn; - if (err) - return err; - - if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) - return grib_get_float_array(grib_handle_of_accessor(a), self->coded_values, val, len); - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if (coded_n_vals == 0) { - for (i = 0; i < n_vals; i++) - val[i] = missing_value; - - *len = n_vals; - return GRIB_SUCCESS; - } - - if ((err = grib_get_float_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) - return err; - - coded_vals = (float*)grib_context_malloc(a->context, coded_n_vals * sizeof(float)); - if (coded_vals == NULL) - return GRIB_OUT_OF_MEMORY; - - if ((err = grib_get_float_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { - grib_context_free(a->context, coded_vals); - return err; - } - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_apply_bitmap: unpack_float : creating %s, %d values", - a->name, n_vals); - - for (i = 0; i < n_vals; i++) { - if (val[i] == 0) { - val[i] = missing_value; - } - else { - val[i] = coded_vals[j++]; - if (j > coded_n_vals) { - grib_context_free(a->context, coded_vals); - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_apply_bitmap [%s]:" - " unpack_float : number of coded values does not match bitmap %ld %ld", - a->name, coded_n_vals, n_vals); - - return GRIB_ARRAY_TOO_SMALL; - } - } - } - - *len = n_vals; - - grib_context_free(a->context, coded_vals); - return err; -} - static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; diff --git a/src/grib_accessor_class_data_apply_bitmap.h b/src/grib_accessor_class_data_apply_bitmap.h new file mode 100644 index 000000000..2d95a05e8 --- /dev/null +++ b/src/grib_accessor_class_data_apply_bitmap.h @@ -0,0 +1,109 @@ +// ECC-1467 +#pragma once + +#include "grib_api_internal_cpp.h" +#include +#include + +typedef struct grib_accessor_data_apply_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_apply_bitmap */ + const char* coded_values; + const char* bitmap; + const char* missing_value; + const char* number_of_data_points; + const char* number_of_values; + const char* binary_scale_factor; +} grib_accessor_data_apply_bitmap; + +template +class GribAccessorDataApplyBitmap { +public: + static int unpack(grib_accessor* a, T* val, size_t* len); +}; + +template +int GribAccessorDataApplyBitmap::unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + + size_t i = 0; + size_t j = 0; + size_t n_vals = 0; + long nn = 0; + int err = 0; + size_t coded_n_vals = 0; + T* coded_vals = NULL; + double missing_value = 0; + + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; + + if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) + return grib_get_array(grib_handle_of_accessor(a), self->coded_values, val, len); + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if (coded_n_vals == 0) { + for (i = 0; i < n_vals; i++) + val[i] = missing_value; + + *len = n_vals; + return GRIB_SUCCESS; + } + + if ((err = grib_get_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) + return err; + + coded_vals = (T*)grib_context_malloc(a->context, coded_n_vals * sizeof(T)); + if (coded_vals == NULL) + return GRIB_OUT_OF_MEMORY; + + if ((err = grib_get_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { + grib_context_free(a->context, coded_vals); + return err; + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_class_data_apply_bitmap: %s : creating %s, %d values", + __PRETTY_FUNCTION__, + a->name, n_vals); + + for (i = 0; i < n_vals; i++) { + if (val[i] == 0) { + val[i] = missing_value; + } + else { + val[i] = coded_vals[j++]; + if (j > coded_n_vals) { + grib_context_free(a->context, coded_vals); + grib_context_log(a->context, GRIB_LOG_ERROR, + "grib_accessor_class_data_apply_bitmap [%s]:" + " %s : number of coded values does not match bitmap %ld %ld", + a->name, __PRETTY_FUNCTION__, coded_n_vals, n_vals); + + return GRIB_ARRAY_TOO_SMALL; + } + } + } + + *len = n_vals; + + grib_context_free(a->context, coded_vals); + return err; +} + diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index a1c1c24b4..6720835c3 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -8,7 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" +#include "grib_accessor_class_data_ccsds_packing.h" /* This is used by make_class.pl @@ -49,36 +49,12 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int unpack_double_element(grib_accessor*, size_t i, double* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); -typedef struct grib_accessor_data_ccsds_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; - /* Members defined in data_ccsds_packing */ - const char* number_of_values; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* bits_per_value; - const char* number_of_data_points; - const char* ccsds_flags; - const char* ccsds_block_size; - const char* ccsds_rsi; -} grib_accessor_data_ccsds_packing; - extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { @@ -104,8 +80,8 @@ static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &unpack_double, /* grib_unpack procedures double */ - &unpack_float, /* grib_unpack procedures float */ + &GribAccessorDataCcsdsPacking::unpack, /* grib_unpack procedures double */ + &GribAccessorDataCcsdsPacking::unpack, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -200,7 +176,7 @@ static int value_count(grib_accessor* a, long* count) #include -static const char* aec_get_error_message(int code) +const char* aec_get_error_message(int code) { if (code == AEC_MEM_ERROR) return "AEC_MEM_ERROR"; if (code == AEC_DATA_ERROR) return "AEC_DATA_ERROR"; @@ -209,7 +185,8 @@ static const char* aec_get_error_message(int code) if (code == AEC_OK) return "AEC_OK"; return "Unknown error code"; } -static void print_aec_stream_info(struct aec_stream* strm, const char* func) + +void print_aec_stream_info(struct aec_stream* strm, const char* func) { fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.flags=%u\n", func, strm->flags); fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.bits_per_sample=%u\n", func, strm->bits_per_sample); @@ -219,232 +196,6 @@ static void print_aec_stream_info(struct aec_stream* strm, const char* func) fprintf(stderr, "ECCODES DEBUG CCSDS %s aec_stream.avail_in=%lu\n", func, strm->avail_in); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - int err = GRIB_SUCCESS, i = 0; - size_t buflen = 0; - struct aec_stream strm; - double bscale = 0; - double dscale = 0; - unsigned char* buf = NULL; - size_t n_vals = 0; - size_t size = 0; - unsigned char* decoded = NULL; - /*unsigned char* p = NULL;*/ - long pos = 0; - long nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - long bits8; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - - self->dirty = 0; - - if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) - return err; - n_vals = nn; - - if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - - /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) - return err; - - /* TODO: This should be called upstream */ - if (*len < n_vals) - return GRIB_ARRAY_TOO_SMALL; - - /* Special case */ - if (bits_per_value == 0) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - bscale = grib_power(binary_scale_factor, 2); - dscale = grib_power(-decimal_scale_factor, 10); - - buflen = grib_byte_count(a); - buf = (unsigned char*)hand->buffer->data; - buf += grib_byte_offset(a); - - strm.flags = ccsds_flags; - strm.bits_per_sample = bits_per_value; - strm.block_size = ccsds_block_size; - strm.rsi = ccsds_rsi; - - strm.next_in = buf; - strm.avail_in = buflen; - - bits8 = ((bits_per_value + 7) / 8) * 8; - size = n_vals * ((bits_per_value + 7) / 8); - decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); - if (!decoded) { - err = GRIB_OUT_OF_MEMORY; - goto cleanup; - } - strm.next_out = decoded; - strm.avail_out = size; - - if (hand->context->debug) print_aec_stream_info(&strm, "unpack_double"); - - if ((err = aec_buffer_decode(&strm)) != AEC_OK) { - grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS unpack_double: aec_buffer_decode error %d (%s)\n", - err, aec_get_error_message(err)); - err = GRIB_ENCODING_ERROR; - goto cleanup; - } - - /* printf("bscale=%g dscale=%g reference_value=%g\n",bscale,dscale,reference_value); */ - pos = 0; -#if 0 - p = decoded; - for (i = 0; i < n_vals; i++) { - val[i] = (double)(((grib_decode_unsigned_long(p, &pos, bits8) * bscale) + reference_value) * dscale); - } -#endif - /* ECC-1427: Performance improvement */ - grib_decode_double_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - *len = n_vals; - -cleanup: - grib_context_buffer_free(a->context, decoded); - return err; -} - -// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! -// Should be merged with unpack_double and refactored! Most probably using C++ templates -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - int err = GRIB_SUCCESS, i = 0; - size_t buflen = 0; - struct aec_stream strm; - double bscale = 0; - double dscale = 0; - unsigned char* buf = NULL; - size_t n_vals = 0; - size_t size = 0; - unsigned char* decoded = NULL; - /*unsigned char* p = NULL;*/ - long pos = 0; - long nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - long bits8; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - - self->dirty = 0; - - if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) - return err; - n_vals = nn; - - if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - - /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) - return err; - - /* TODO: This should be called upstream */ - if (*len < n_vals) - return GRIB_ARRAY_TOO_SMALL; - - /* Special case */ - if (bits_per_value == 0) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - bscale = grib_power(binary_scale_factor, 2); - dscale = grib_power(-decimal_scale_factor, 10); - - buflen = grib_byte_count(a); - buf = (unsigned char*)hand->buffer->data; - buf += grib_byte_offset(a); - - strm.flags = ccsds_flags; - strm.bits_per_sample = bits_per_value; - strm.block_size = ccsds_block_size; - strm.rsi = ccsds_rsi; - - strm.next_in = buf; - strm.avail_in = buflen; - - bits8 = ((bits_per_value + 7) / 8) * 8; - size = n_vals * ((bits_per_value + 7) / 8); - decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); - if (!decoded) { - err = GRIB_OUT_OF_MEMORY; - goto cleanup; - } - strm.next_out = decoded; - strm.avail_out = size; - - if (hand->context->debug) print_aec_stream_info(&strm, "unpack_float"); - - if ((err = aec_buffer_decode(&strm)) != AEC_OK) { - grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS unpack_float: aec_buffer_decode error %d (%s)\n", - err, aec_get_error_message(err)); - err = GRIB_ENCODING_ERROR; - goto cleanup; - } - - pos = 0; - - /* ECC-1427: Performance improvement */ - grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - *len = n_vals; - -cleanup: - grib_context_buffer_free(a->context, decoded); - return err; -} - static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; @@ -787,16 +538,6 @@ static void print_error_feature_not_enabled(grib_context* c) "grib_accessor_data_ccsds_packing: CCSDS support not enabled. " "Please rebuild with -DENABLE_AEC=ON (Adaptive Entropy Coding library)"); } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - print_error_feature_not_enabled(a->context); - return GRIB_FUNCTIONALITY_NOT_ENABLED; -} -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ - print_error_feature_not_enabled(a->context); - return GRIB_FUNCTIONALITY_NOT_ENABLED; -} static int pack_double(grib_accessor* a, const double* val, size_t* len) { print_error_feature_not_enabled(a->context); diff --git a/src/grib_accessor_class_data_ccsds_packing.h b/src/grib_accessor_class_data_ccsds_packing.h new file mode 100644 index 000000000..95169eb8a --- /dev/null +++ b/src/grib_accessor_class_data_ccsds_packing.h @@ -0,0 +1,160 @@ +#pragma once +#include "grib_api_internal_cpp.h" + +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) +#include +const char* aec_get_error_message(int code); +void print_aec_stream_info(struct aec_stream* strm, const char* func); +#endif + +//static int unpack_double(grib_accessor*, double* val, size_t* len); +//static int unpack_float(grib_accessor*, float* val, size_t* len); + +typedef struct grib_accessor_data_ccsds_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_ccsds_packing */ + const char* number_of_values; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* bits_per_value; + const char* number_of_data_points; + const char* ccsds_flags; + const char* ccsds_block_size; + const char* ccsds_rsi; +} grib_accessor_data_ccsds_packing; + + +template +class GribAccessorDataCcsdsPacking { +public: + +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) + static int unpack(grib_accessor* a, T* val, size_t* len) + { + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + int err = GRIB_SUCCESS, i = 0; + size_t buflen = 0; + struct aec_stream strm; + double bscale = 0; + double dscale = 0; + unsigned char* buf = NULL; + size_t n_vals = 0; + size_t size = 0; + unsigned char* decoded = NULL; + /*unsigned char* p = NULL;*/ + long pos = 0; + long nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + long bits8; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + + self->dirty = 0; + + if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + return err; + n_vals = nn; + + if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + + /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) + return err; + + /* TODO: This should be called upstream */ + if (*len < n_vals) + return GRIB_ARRAY_TOO_SMALL; + + /* Special case */ + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } + + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); + + buflen = grib_byte_count(a); + buf = (unsigned char*)hand->buffer->data; + buf += grib_byte_offset(a); + + strm.flags = ccsds_flags; + strm.bits_per_sample = bits_per_value; + strm.block_size = ccsds_block_size; + strm.rsi = ccsds_rsi; + + strm.next_in = buf; + strm.avail_in = buflen; + + bits8 = ((bits_per_value + 7) / 8) * 8; + size = n_vals * ((bits_per_value + 7) / 8); + decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); + if (!decoded) { + err = GRIB_OUT_OF_MEMORY; + goto cleanup; + } + strm.next_out = decoded; + strm.avail_out = size; + + if (hand->context->debug) print_aec_stream_info(&strm, "unpack_*"); + + if ((err = aec_buffer_decode(&strm)) != AEC_OK) { + grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS %s: aec_buffer_decode error %d (%s)\n", + __PRETTY_FUNCTION__, err, aec_get_error_message(err)); + err = GRIB_ENCODING_ERROR; + goto cleanup; + } + + pos = 0; + + /* ECC-1427: Performance improvement */ + //grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + *len = n_vals; + + cleanup: + grib_context_buffer_free(a->context, decoded); + return err; + } + +#else + static int unpack(grib_accessor* a, float* val, size_t* len) + { + print_error_feature_not_enabled(a->context); + return GRIB_FUNCTIONALITY_NOT_ENABLED; + } +#endif + +}; + diff --git a/src/grib_accessor_class_data_complex_packing.cc b/src/grib_accessor_class_data_complex_packing.cc index 225f8d34d..0631b3b80 100644 --- a/src/grib_accessor_class_data_complex_packing.cc +++ b/src/grib_accessor_class_data_complex_packing.cc @@ -8,7 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" +#include "grib_accessor_class_data_complex_packing.h" #include "grib_optimize_decimal_factor.h" #include /* @@ -48,45 +48,10 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef struct grib_accessor_data_complex_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; - /* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; - /* Members defined in data_complex_packing */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; -} grib_accessor_data_complex_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; @@ -113,8 +78,8 @@ static grib_accessor_class _grib_accessor_class_data_complex_packing = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &unpack_double, /* grib_unpack procedures double */ - &unpack_float, /* grib_unpack procedures float */ + &GribAccessorClassDataComplexPacking::unpack, /* grib_unpack procedures double */ + &GribAccessorClassDataComplexPacking::unpack, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -181,8 +146,6 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ -typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); static void init(grib_accessor* a, const long v, grib_arguments* args) { @@ -234,443 +197,6 @@ static int value_count(grib_accessor* a, long* count) return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - double* scals = NULL; - double *pscals = NULL, *pval = NULL; - - double s = 0; - double d = 0; - double laplacianOperator = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; - unsigned long packed_offset; - long lpos = 0; - - long maxv = 0; - long GRIBEX_sh_bug_present = 0; - long ieee_floats = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - - long sub_j = 0; - long sub_k = 0; - long sub_m = 0; - long pen_j = 0; - long pen_k = 0; - long pen_m = 0; - - double operat = 0; - int bytes; - int err = 0; - - decode_float_proc decode_float = NULL; - - err = grib_value_count(a, &n_vals); - if (err) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) - return ret; - - /* ECC-774: don't use grib_get_long_internal */ - if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) - return ret; - - self->dirty = 0; - - switch (ieee_floats) { - case 0: - decode_float = grib_long_to_ibm; - bytes = 4; - break; - case 1: - decode_float = grib_long_to_ieee; - bytes = 4; - break; - case 2: - decode_float = grib_long_to_ieee64; - bytes = 8; - break; - default: - return GRIB_NOT_IMPLEMENTED; - } - - Assert(sub_j == sub_k); - Assert(sub_j == sub_m); - Assert(pen_j == pen_k); - Assert(pen_j == pen_m); - - buf = (unsigned char*)gh->buffer->data; - - maxv = pen_j + 1; - - buf += grib_byte_offset(a); - hres = buf; - lres = buf; - - if (pen_j == sub_j) { - n_vals = (pen_j + 1) * (pen_j + 2); - d = grib_power(-decimal_scale_factor, 10); - grib_ieee_decode_array(a->context, buf, n_vals, bytes, val); - if (d) { - for (i = 0; i < n_vals; i++) - val[i] *= d; - } - return 0; - } - - packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); - - lpos = 8 * (packed_offset - offsetdata); - - s = grib_power(binary_scale_factor, 2); - d = grib_power(-decimal_scale_factor, 10); - - scals = (double*)grib_context_malloc(a->context, maxv * sizeof(double)); - Assert(scals); - - scals[0] = 0; - for (i = 1; i < maxv; i++) { - operat = pow(i * (i + 1), laplacianOperator); - if (operat != 0) - scals[i] = (1.0 / operat); - else { - grib_context_log(a->context, GRIB_LOG_WARNING, - "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", - i, maxv); - scals[i] = 0; - } - } - - /* - printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); - printf("packed offset=%ld\n",packed_offset); - for(i=0;i 0) { - lup = mmax; - if (sub_k >= 0) { - for (hcount = 0; hcount < sub_k + 1; hcount++) { - val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - - if (GRIBEX_sh_bug_present && hcount == sub_k) { - /* bug in ecmwf data, last row (K+1)is scaled but should not */ - val[i - 2] *= scals[lup]; - val[i - 1] *= scals[lup]; - } - lup++; - } - sub_k--; - } - - pscals = scals + lup; - pval = val + i; -#if FAST_BIG_ENDIAN - grib_decode_double_array_complex(lres, - &lpos, bits_per_value, - reference_value, s, pscals, (maxv - hcount) * 2, pval); - i += (maxv - hcount) * 2; -#else - (void)pscals; /* suppress gcc warning */ - (void)pval; /* suppress gcc warning */ - for (lcount = hcount; lcount < maxv; lcount++) { - val[i++] = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; - val[i++] = d * (double)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; - /* These values should always be zero, but as they are packed, - it is necessary to force them back to zero */ - if (mmax == 0) - val[i - 1] = 0; - lup++; - } -#endif - - maxv--; - hcount = 0; - mmax++; - } - - - Assert(*len >= i); - *len = i; - - grib_context_free(a->context, scals); - - return ret; -} - - - -// TODO(maee): ECC-1467 -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - float* scals = NULL; - float *pscals = NULL, *pval = NULL; - - double s = 0; - double d = 0; - double laplacianOperator = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; - unsigned long packed_offset; - long lpos = 0; - - long maxv = 0; - long GRIBEX_sh_bug_present = 0; - long ieee_floats = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - - long sub_j = 0; - long sub_k = 0; - long sub_m = 0; - long pen_j = 0; - long pen_k = 0; - long pen_m = 0; - - float operat = 0; - int bytes; - int err = 0; - - decode_float_proc decode_float = NULL; - - err = grib_value_count(a, &n_vals); - if (err) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) - return ret; - - /* ECC-774: don't use grib_get_long_internal */ - if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) - return ret; - - self->dirty = 0; - - switch (ieee_floats) { - case 0: - decode_float = grib_long_to_ibm; - bytes = 4; - break; - case 1: - decode_float = grib_long_to_ieee; - bytes = 4; - break; - case 2: - decode_float = grib_long_to_ieee64; - bytes = 8; - break; - default: - return GRIB_NOT_IMPLEMENTED; - } - - Assert(sub_j == sub_k); - Assert(sub_j == sub_m); - Assert(pen_j == pen_k); - Assert(pen_j == pen_m); - - buf = (unsigned char*)gh->buffer->data; - - maxv = pen_j + 1; - - buf += grib_byte_offset(a); - hres = buf; - lres = buf; - - if (pen_j == sub_j) { - n_vals = (pen_j + 1) * (pen_j + 2); - d = grib_power(-decimal_scale_factor, 10); - grib_ieee_decode_array_float(a->context, buf, n_vals, bytes, val); - if (d) { - for (i = 0; i < n_vals; i++) - val[i] *= d; - } - return 0; - } - - - packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); - - lpos = 8 * (packed_offset - offsetdata); - - s = grib_power(binary_scale_factor, 2); - d = grib_power(-decimal_scale_factor, 10); - - scals = (float*)grib_context_malloc(a->context, maxv * sizeof(float)); - Assert(scals); - - scals[0] = 0; - for (i = 1; i < maxv; i++) { - operat = pow(i * (i + 1), laplacianOperator); - if (operat != 0) - scals[i] = (1.0 / operat); - else { - grib_context_log(a->context, GRIB_LOG_WARNING, - "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", - i, maxv); - scals[i] = 0; - } - } - - /* - printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); - printf("packed offset=%ld\n",packed_offset); - for(i=0;i 0) { - lup = mmax; - if (sub_k >= 0) { - for (hcount = 0; hcount < sub_k + 1; hcount++) { - val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - - if (GRIBEX_sh_bug_present && hcount == sub_k) { - /* bug in ecmwf data, last row (K+1)is scaled but should not */ - val[i - 2] *= scals[lup]; - val[i - 1] *= scals[lup]; - } - lup++; - } - sub_k--; - } - - pscals = scals + lup; - pval = val + i; -#if FAST_BIG_ENDIAN - grib_decode_double_array_complex(lres, - &lpos, bits_per_value, - reference_value, s, pscals, (maxv - hcount) * 2, pval); - i += (maxv - hcount) * 2; -#else - (void)pscals; /* suppress gcc warning */ - (void)pval; /* suppress gcc warning */ - for (lcount = hcount; lcount < maxv; lcount++) { - val[i++] = d * (float)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; - val[i++] = d * (float)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; - /* These values should always be zero, but as they are packed, - it is necessary to force them back to zero */ - if (mmax == 0) - val[i - 1] = 0; - lup++; - } -#endif - - maxv--; - hcount = 0; - mmax++; - } - - Assert(*len >= i); - *len = i; - - grib_context_free(a->context, scals); - - return ret; -} - #define MAXVAL(a, b) a > b ? a : b static double calculate_pfactor(grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation) diff --git a/src/grib_accessor_class_data_complex_packing.h b/src/grib_accessor_class_data_complex_packing.h new file mode 100644 index 000000000..52cf64893 --- /dev/null +++ b/src/grib_accessor_class_data_complex_packing.h @@ -0,0 +1,269 @@ +// ECC-1467 + +#pragma once + +#include "grib_api_internal_cpp.h" +#include + +typedef unsigned long (*encode_float_proc)(double); +typedef double (*decode_float_proc)(unsigned long); + +typedef struct grib_accessor_data_complex_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_complex_packing */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; +} grib_accessor_data_complex_packing; + + +template +class GribAccessorClassDataComplexPacking { +public: + static int unpack(grib_accessor* a, T* val, size_t* len); +}; + + +template +int GribAccessorClassDataComplexPacking::unpack(grib_accessor* a, T* val, size_t* len) +{ + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + T* scals = NULL; + T*pscals = NULL, *pval = NULL; + + double s = 0; + double d = 0; + double laplacianOperator = 0; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; + unsigned long packed_offset; + long lpos = 0; + + long maxv = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + T operat = 0; + int bytes; + int err = 0; + + decode_float_proc decode_float = NULL; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) + return ret; + + /* ECC-774: don't use grib_get_long_internal */ + if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) + return ret; + + self->dirty = 0; + + switch (ieee_floats) { + case 0: + decode_float = grib_long_to_ibm; + bytes = 4; + break; + case 1: + decode_float = grib_long_to_ieee; + bytes = 4; + break; + case 2: + decode_float = grib_long_to_ieee64; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; + } + + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); + + buf = (unsigned char*)gh->buffer->data; + + maxv = pen_j + 1; + + buf += grib_byte_offset(a); + hres = buf; + lres = buf; + + if (pen_j == sub_j) { + n_vals = (pen_j + 1) * (pen_j + 2); + d = grib_power(-decimal_scale_factor, 10); + grib_ieee_decode_array(a->context, buf, n_vals, bytes, val); + if (d) { + for (i = 0; i < n_vals; i++) + val[i] *= d; + } + return 0; + } + + + packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); + + lpos = 8 * (packed_offset - offsetdata); + + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); + + scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); + Assert(scals); + + scals[0] = 0; + for (i = 1; i < maxv; i++) { + operat = pow(i * (i + 1), laplacianOperator); + if (operat != 0) + scals[i] = (1.0 / operat); + else { + grib_context_log(a->context, GRIB_LOG_WARNING, + "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", + i, maxv); + scals[i] = 0; + } + } + + /* + printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); + printf("packed offset=%ld\n",packed_offset); + for(i=0;i 0) { + lup = mmax; + if (sub_k >= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + + if (GRIBEX_sh_bug_present && hcount == sub_k) { + /* bug in ecmwf data, last row (K+1)is scaled but should not */ + val[i - 2] *= scals[lup]; + val[i - 1] *= scals[lup]; + } + lup++; + } + sub_k--; + } + + pscals = scals + lup; + pval = val + i; +#if FAST_BIG_ENDIAN + grib_decode_double_array_complex(lres, + &lpos, bits_per_value, + reference_value, s, pscals, (maxv - hcount) * 2, pval); + i += (maxv - hcount) * 2; +#else + (void)pscals; /* suppress gcc warning */ + (void)pval; /* suppress gcc warning */ + for (lcount = hcount; lcount < maxv; lcount++) { + val[i++] = d * (T)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + val[i++] = d * (T)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + /* These values should always be zero, but as they are packed, + it is necessary to force them back to zero */ + if (mmax == 0) + val[i - 1] = 0; + lup++; + } +#endif + + maxv--; + hcount = 0; + mmax++; + } + + Assert(*len >= i); + *len = i; + + grib_context_free(a->context, scals); + + return ret; +} diff --git a/src/grib_accessor_class_data_raw_packing.cc b/src/grib_accessor_class_data_raw_packing.cc index c89adaa98..acceae597 100644 --- a/src/grib_accessor_class_data_raw_packing.cc +++ b/src/grib_accessor_class_data_raw_packing.cc @@ -11,7 +11,7 @@ * Enrico Fucile ****************************/ -#include "grib_api_internal.h" +#include "grib_api_internal_cpp.h" #define PRE_PROCESSING_NONE 0 #define PRE_PROCESSING_DIFFERENCE 1 @@ -210,7 +210,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) if (*len < nvals) return GRIB_ARRAY_TOO_SMALL; - code = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); + code = grib_ieee_decode_array(a->context, buf, nvals, bytes, val); *len = nvals; diff --git a/src/grib_accessor_class_data_simple_packing.cc b/src/grib_accessor_class_data_simple_packing.cc index 4cedeb4b6..fd647e252 100644 --- a/src/grib_accessor_class_data_simple_packing.cc +++ b/src/grib_accessor_class_data_simple_packing.cc @@ -12,7 +12,7 @@ * Enrico Fucile *******************************/ -#include "grib_api_internal.h" +#include "grib_api_internal_cpp.h" #include "grib_optimize_decimal_factor.h" #include @@ -442,9 +442,9 @@ static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len "unpack_double: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); if(dval) - grib_decode_double_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, dval); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, dval); if(fval) - grib_decode_float_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, fval); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, fval); *len = (long)n_vals; @@ -586,7 +586,7 @@ static int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned c grib_context_log(a->context, GRIB_LOG_DEBUG, "unpack_double: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); - grib_decode_double_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); *len = (long)n_vals; diff --git a/src/grib_accessor_class_gen.cc b/src/grib_accessor_class_gen.cc index 76138d8d8..6cd7d898b 100644 --- a/src/grib_accessor_class_gen.cc +++ b/src/grib_accessor_class_gen.cc @@ -13,7 +13,7 @@ * Enrico Fucile * * Shahram Najm * ***************************************************************************/ -#include "grib_api_internal.h" +#include "grib_accessor_class_gen.h" /* This is used by make_class.pl @@ -56,10 +56,6 @@ static int pack_string(grib_accessor*, const char*, size_t* len); static int pack_string_array(grib_accessor*, const char**, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_float(grib_accessor*, float* val, size_t* len); -static int unpack_long(grib_accessor*, long* val, size_t* len); -static int unpack_string(grib_accessor*, char*, size_t* len); static int unpack_string_array(grib_accessor*, char**, size_t* len); static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); @@ -108,13 +104,13 @@ static grib_accessor_class _grib_accessor_class_gen = { 0, /* grib_pack procedures long */ &is_missing, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ - &unpack_long, /* grib_unpack procedures long */ + &GribAccessorClassGen::unpack, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &unpack_double, /* grib_unpack procedures double */ - &unpack_float, /* grib_unpack procedures float */ + &GribAccessorClassGen::unpack, /* grib_unpack procedures double */ + &GribAccessorClassGen::unpack, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ - &unpack_string, /* grib_unpack procedures string */ + &GribAccessorClassGen::unpack, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ &unpack_string_array, /* grib_unpack array procedures string */ &pack_bytes, /* grib_pack procedures bytes */ @@ -274,10 +270,12 @@ static int clear(grib_accessor* a) return GRIB_SUCCESS; } -static int unpack_long(grib_accessor* a, long* v, size_t* len) +// ECC-1467 +template <> +int GribAccessorClassGen::unpack(grib_accessor* a, long* v, size_t* len) { int type = GRIB_TYPE_UNDEFINED; - if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { + if (a->cclass->unpack_double && a->cclass->unpack_double != &GribAccessorClassGen::unpack) { double val = 0.0; size_t l = 1; grib_unpack_double(a, &val, &l); @@ -289,7 +287,7 @@ static int unpack_long(grib_accessor* a, long* v, size_t* len) return GRIB_SUCCESS; } - if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { + if (a->cclass->unpack_string && a->cclass->unpack_string != &GribAccessorClassGen::unpack) { char val[1024]; size_t l = sizeof(val); char* last = NULL; @@ -310,48 +308,18 @@ static int unpack_long(grib_accessor* a, long* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } -static int unpack_double(grib_accessor* a, double* v, size_t* len) -{ - int type = GRIB_TYPE_UNDEFINED; - if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { - long val = 0; - size_t l = 1; - grib_unpack_long(a, &val, &l); - *v = val; - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to double", a->name); - return GRIB_SUCCESS; - } - - if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { - char val[1024]; - size_t l = sizeof(val); - char* last = NULL; - grib_unpack_string(a, val, &l); - - *v = strtod(val, &last); - if (*last == 0) { /* conversion of string to double worked */ - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); - return GRIB_SUCCESS; - } - } - - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as double", a->name); - if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); - } - - return GRIB_NOT_IMPLEMENTED; -} - -// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! -static int unpack_float(grib_accessor* a, float* v, size_t* len) +// ECC-1467 +template <> +int GribAccessorClassGen::unpack(grib_accessor* a, float* v, size_t* len) { return GRIB_NOT_IMPLEMENTED; } -static int unpack_string(grib_accessor* a, char* v, size_t* len) +// ECC-1467 +template <> +int GribAccessorClassGen::unpack(grib_accessor* a, char* v, size_t* len) { - if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { + if (a->cclass->unpack_double && a->cclass->unpack_double != &GribAccessorClassGen::unpack) { double val = 0.0; size_t l = 1; grib_unpack_double(a, &val, &l); @@ -361,7 +329,7 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) return GRIB_SUCCESS; } - if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { + if (a->cclass->unpack_long && a->cclass->unpack_long != &GribAccessorClassGen::unpack) { long val = 0; size_t l = 1; grib_unpack_long(a, &val, &l); diff --git a/src/grib_accessor_class_gen.h b/src/grib_accessor_class_gen.h new file mode 100644 index 000000000..5e8355c1f --- /dev/null +++ b/src/grib_accessor_class_gen.h @@ -0,0 +1,53 @@ +// ECC-1467 + +#pragma once + +#include "grib_api_internal_cpp.h" +#include +#include + +template +class GribAccessorClassGen { +public: + static int unpack(grib_accessor* a, T* v, size_t* len); +}; + +template <> int GribAccessorClassGen::unpack(grib_accessor* a, long* v, size_t* len); +template <> int GribAccessorClassGen::unpack(grib_accessor* a, char* v, size_t* len); +template <> int GribAccessorClassGen::unpack(grib_accessor* a, float* v, size_t* len); + + +template +int GribAccessorClassGen::unpack(grib_accessor* a, T* v, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + int type = GRIB_TYPE_UNDEFINED; + if (a->cclass->unpack_long && a->cclass->unpack_long != &GribAccessorClassGen::unpack) { + long val = 0; + size_t l = 1; + grib_unpack_long(a, &val, &l); + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, typeid(T).name()); + return GRIB_SUCCESS; + } + + if (a->cclass->unpack_string && a->cclass->unpack_string != &GribAccessorClassGen::unpack) { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + grib_unpack_string(a, val, &l); + + *v = strtod(val, &last); + if (*last == 0) { /* conversion of string to double worked */ + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); + return GRIB_SUCCESS; + } + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as %s", a->name, typeid(T).name()); + if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); + } + + return GRIB_NOT_IMPLEMENTED; +} diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 878d1d157..da2fa37ac 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -16,7 +16,6 @@ #ifndef grib_api_internal_H #define grib_api_internal_H - #ifdef __cplusplus extern "C" { #endif @@ -253,6 +252,8 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type); #define GRIB_COMPARE_NAMES (1 << 0) #define GRIB_COMPARE_TYPES (1 << 1) +extern const int max_nbits; + typedef struct grib_expression grib_expression; typedef struct grib_arguments grib_arguments; @@ -1606,11 +1607,14 @@ typedef struct j2k_encode_helper #include "eccodes_prototypes.h" - #ifdef __cplusplus } #endif + #endif + + + /* This part is automatically generated by ./errors.pl, do not edit */ #ifndef grib_errors_internal_H #define grib_errors_internal_H diff --git a/src/grib_api_internal_cpp.h b/src/grib_api_internal_cpp.h new file mode 100644 index 000000000..5ff71478b --- /dev/null +++ b/src/grib_api_internal_cpp.h @@ -0,0 +1,5 @@ +#pragma once + +#include "grib_value.h" +#include "grib_bits_any_endian_simple.h" +#include "grib_ieeefloat.h" diff --git a/src/grib_bits.cc b/src/grib_bits.cc index 5be5d4251..92482612b 100644 --- a/src/grib_bits.cc +++ b/src/grib_bits.cc @@ -48,7 +48,7 @@ static const unsigned long dmasks[] = { 0x00, }; -static const int max_nbits = sizeof(unsigned long) * 8; +extern const int max_nbits = sizeof(unsigned long) * 8; static const int max_nbits_size_t = sizeof(size_t) * 8; unsigned long grib_decode_unsigned_byte_long(const unsigned char* p, long o, int l) diff --git a/src/grib_bits_any_endian_simple.cc b/src/grib_bits_any_endian_simple.cc index 93e450a03..e7291c283 100644 --- a/src/grib_bits_any_endian_simple.cc +++ b/src/grib_bits_any_endian_simple.cc @@ -13,10 +13,7 @@ * * ***************************************************************************/ -/* A mask with x least-significant bits set, possibly 0 or >=32 */ -/* -1UL is 1111111... in every bit in binary representation */ -#define BIT_MASK1(x) \ - (((x) >= max_nbits) ? (unsigned long)-1UL : (1UL << (x)) - 1) +#include "grib_bits_any_endian_simple.h" /** * decode an array of n_vals values from a octet-stream @@ -79,178 +76,90 @@ int grib_decode_long_array(const unsigned char* p, long* bitp, long bitsPerValue * @param n_vals number of values to decode * @param val output, values encoded as 32/64bit numbers */ -int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, - double reference_value, double s, double d, - size_t n_vals, double* val) -{ - long i = 0; - unsigned long lvalue = 0; - double x; - -#if 0 - /* slow reference code */ - int j=0; - for(i=0;i < n_vals;i++) { - lvalue=0; - for(j=0; j< bitsPerValue;j++){ - lvalue <<= 1; - if(grib_get_bit( p, *bitp)) lvalue += 1; - *bitp += 1; - } - x=((lvalue*s)+reference_value)*d; - val[i] = (double)x; - } -#endif - if (bitsPerValue % 8 == 0) { - /* See ECC-386 */ - int bc; - int l = bitsPerValue / 8; - size_t o = 0; - - for (i = 0; i < n_vals; i++) { - lvalue = 0; - lvalue <<= 8; - lvalue |= p[o++]; - - for (bc = 1; bc < l; bc++) { - lvalue <<= 8; - lvalue |= p[o++]; - } - x = ((lvalue * s) + reference_value) * d; - val[i] = (double)x; - /* *bitp += bitsPerValue * n_vals; */ - } - } - else { - unsigned long mask = BIT_MASK1(bitsPerValue); - - /* pi: position of bitp in p[]. >>3 == /8 */ - long pi = *bitp / 8; - /* some bits might of the current byte at pi might be used */ - /* by the previous number usefulBitsInByte gives remaining unused bits */ - /* number of useful bits in current byte */ - int usefulBitsInByte = 8 - (*bitp & 7); - for (i = 0; i < n_vals; i++) { - /* value read as long */ - long bitsToRead = 0; - lvalue = 0; - bitsToRead = bitsPerValue; - /* read one byte after the other to lvalue until >= bitsPerValue are read */ - while (bitsToRead > 0) { - lvalue <<= 8; - lvalue += p[pi]; - pi++; - bitsToRead -= usefulBitsInByte; - usefulBitsInByte = 8; - } - *bitp += bitsPerValue; - /* bitsToRead is now <= 0, remove the last bits */ - lvalue >>= -1 * bitsToRead; - /* set leading bits to 0 - removing bits used for previous number */ - lvalue &= mask; - - usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ - if (usefulBitsInByte > 0) { - pi--; /* reread the current byte */ - } - else { - usefulBitsInByte = 8; /* start with next full byte */ - } - /* scaling and move value to output */ - x = ((lvalue * s) + reference_value) * d; - val[i] = (double)x; - } - } - return 0; -} - -// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! -// This and the grib_decode_double_array function -// should be merged and refactored! Most probably using C++ templates -int grib_decode_float_array(const unsigned char* p, long* bitp, long bitsPerValue, - double reference_value, double s, double d, - size_t n_vals, float* val) -{ - long i = 0; - unsigned long lvalue = 0; - double x; - -#if 0 - /* slow reference code */ - int j=0; - for(i=0;i < n_vals;i++) { - lvalue=0; - for(j=0; j< bitsPerValue;j++){ - lvalue <<= 1; - if(grib_get_bit( p, *bitp)) lvalue += 1; - *bitp += 1; - } - x=((lvalue*s)+reference_value)*d; - val[i] = (double)x; - } -#endif - if (bitsPerValue % 8 == 0) { - /* See ECC-386 */ - int bc; - int l = bitsPerValue / 8; - size_t o = 0; - - for (i = 0; i < n_vals; i++) { - lvalue = 0; - lvalue <<= 8; - lvalue |= p[o++]; - - for (bc = 1; bc < l; bc++) { - lvalue <<= 8; - lvalue |= p[o++]; - } - x = ((lvalue * s) + reference_value) * d; - val[i] = (float)x; - /* *bitp += bitsPerValue * n_vals; */ - } - } - else { - unsigned long mask = BIT_MASK1(bitsPerValue); - - /* pi: position of bitp in p[]. >>3 == /8 */ - long pi = *bitp / 8; - /* some bits might of the current byte at pi might be used */ - /* by the previous number usefulBitsInByte gives remaining unused bits */ - /* number of useful bits in current byte */ - int usefulBitsInByte = 8 - (*bitp & 7); - for (i = 0; i < n_vals; i++) { - /* value read as long */ - long bitsToRead = 0; - lvalue = 0; - bitsToRead = bitsPerValue; - /* read one byte after the other to lvalue until >= bitsPerValue are read */ - while (bitsToRead > 0) { - lvalue <<= 8; - lvalue += p[pi]; - pi++; - bitsToRead -= usefulBitsInByte; - usefulBitsInByte = 8; - } - *bitp += bitsPerValue; - /* bitsToRead is now <= 0, remove the last bits */ - lvalue >>= -1 * bitsToRead; - /* set leading bits to 0 - removing bits used for previous number */ - lvalue &= mask; - - usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ - if (usefulBitsInByte > 0) { - pi--; /* reread the current byte */ - } - else { - usefulBitsInByte = 8; /* start with next full byte */ - } - /* scaling and move value to output */ - x = ((lvalue * s) + reference_value) * d; - val[i] = (float)x; - } - } - return 0; -} +//int grib_decode_double_array(const unsigned char* p, long* bitp, long bitsPerValue, +// double reference_value, double s, double d, +// size_t n_vals, double* val) +//{ +// long i = 0; +// unsigned long lvalue = 0; +// double x; + +//#if 0 +// [> slow reference code <] +// int j=0; +// for(i=0;i < n_vals;i++) { +// lvalue=0; +// for(j=0; j< bitsPerValue;j++){ +// lvalue <<= 1; +// if(grib_get_bit( p, *bitp)) lvalue += 1; +// *bitp += 1; +// } +// x=((lvalue*s)+reference_value)*d; +// val[i] = (double)x; +// } +//#endif +// if (bitsPerValue % 8 == 0) { +// [> See ECC-386 <] +// int bc; +// int l = bitsPerValue / 8; +// size_t o = 0; + +// for (i = 0; i < n_vals; i++) { +// lvalue = 0; +// lvalue <<= 8; +// lvalue |= p[o++]; + +// for (bc = 1; bc < l; bc++) { +// lvalue <<= 8; +// lvalue |= p[o++]; +// } +// x = ((lvalue * s) + reference_value) * d; +// val[i] = (double)x; +// [> *bitp += bitsPerValue * n_vals; <] +// } +// } +// else { +// unsigned long mask = BIT_MASK1(bitsPerValue); + +// [> pi: position of bitp in p[]. >>3 == /8 <] +// long pi = *bitp / 8; +// [> some bits might of the current byte at pi might be used <] +// [> by the previous number usefulBitsInByte gives remaining unused bits <] +// [> number of useful bits in current byte <] +// int usefulBitsInByte = 8 - (*bitp & 7); +// for (i = 0; i < n_vals; i++) { +// [> value read as long <] +// long bitsToRead = 0; +// lvalue = 0; +// bitsToRead = bitsPerValue; +// [> read one byte after the other to lvalue until >= bitsPerValue are read <] +// while (bitsToRead > 0) { +// lvalue <<= 8; +// lvalue += p[pi]; +// pi++; +// bitsToRead -= usefulBitsInByte; +// usefulBitsInByte = 8; +// } +// *bitp += bitsPerValue; +// [> bitsToRead is now <= 0, remove the last bits <] +// lvalue >>= -1 * bitsToRead; +// [> set leading bits to 0 - removing bits used for previous number <] +// lvalue &= mask; + +// usefulBitsInByte = -1 * bitsToRead; [> prepare for next round <] +// if (usefulBitsInByte > 0) { +// pi--; [> reread the current byte <] +// } +// else { +// usefulBitsInByte = 8; [> start with next full byte <] +// } +// [> scaling and move value to output <] +// x = ((lvalue * s) + reference_value) * d; +// val[i] = (double)x; +// } +// } +// return 0; +//} int grib_decode_double_array_complex(const unsigned char* p, long* bitp, long nbits, double reference_value, double s, double* d, size_t size, double* val) { diff --git a/src/grib_bits_any_endian_simple.h b/src/grib_bits_any_endian_simple.h new file mode 100644 index 000000000..7c41f1c01 --- /dev/null +++ b/src/grib_bits_any_endian_simple.h @@ -0,0 +1,97 @@ +// ECC-1467 + +#pragma once + +#include "grib_api_internal.h" + +/* A mask with x least-significant bits set, possibly 0 or >=32 */ +/* -1UL is 1111111... in every bit in binary representation */ +#define BIT_MASK1(x) \ + (((x) >= max_nbits) ? (unsigned long)-1UL : (1UL << (x)) - 1) + + +template +int grib_decode_array(const unsigned char* p, long* bitp, long bitsPerValue, + double reference_value, double s, double d, + size_t n_vals, T* val) +{ + size_t i = 0; + unsigned long lvalue = 0; + double x; + +#if 0 + /* slow reference code */ + int j=0; + for(i=0; i < n_vals; i++) { + lvalue=0; + for(j=0; j< bitsPerValue;j++){ + lvalue <<= 1; + if(grib_get_bit( p, *bitp)) lvalue += 1; + *bitp += 1; + } + x=((lvalue*s)+reference_value)*d; + val[i] = (double)x; + } +#endif + if (bitsPerValue % 8 == 0) { + /* See ECC-386 */ + int bc; + int l = bitsPerValue / 8; + size_t o = 0; + + for (i = 0; i < n_vals; i++) { + lvalue = 0; + lvalue <<= 8; + lvalue |= p[o++]; + + for (bc = 1; bc < l; bc++) { + lvalue <<= 8; + lvalue |= p[o++]; + } + x = ((lvalue * s) + reference_value) * d; + val[i] = (T)x; + /* *bitp += bitsPerValue * n_vals; */ + } + } + else { + unsigned long mask = BIT_MASK1(bitsPerValue); + + /* pi: position of bitp in p[]. >>3 == /8 */ + long pi = *bitp / 8; + /* some bits might of the current byte at pi might be used */ + /* by the previous number usefulBitsInByte gives remaining unused bits */ + /* number of useful bits in current byte */ + int usefulBitsInByte = 8 - (*bitp & 7); + for (i = 0; i < n_vals; i++) { + /* value read as long */ + long bitsToRead = 0; + lvalue = 0; + bitsToRead = bitsPerValue; + /* read one byte after the other to lvalue until >= bitsPerValue are read */ + while (bitsToRead > 0) { + lvalue <<= 8; + lvalue += p[pi]; + pi++; + bitsToRead -= usefulBitsInByte; + usefulBitsInByte = 8; + } + *bitp += bitsPerValue; + /* bitsToRead is now <= 0, remove the last bits */ + lvalue >>= -1 * bitsToRead; + /* set leading bits to 0 - removing bits used for previous number */ + lvalue &= mask; + + usefulBitsInByte = -1 * bitsToRead; /* prepare for next round */ + if (usefulBitsInByte > 0) { + pi--; /* reread the current byte */ + } + else { + usefulBitsInByte = 8; /* start with next full byte */ + } + /* scaling and move value to output */ + x = ((lvalue * s) + reference_value) * d; + val[i] = (T)x; + } + } + return 0; +} diff --git a/src/grib_ieeefloat.cc b/src/grib_ieeefloat.cc index 1f6dbb426..5ed74163a 100644 --- a/src/grib_ieeefloat.cc +++ b/src/grib_ieeefloat.cc @@ -12,7 +12,7 @@ * Enrico Fucile - 06.01.2009 * * * ***************************************************************************/ -#include "grib_api_internal.h" +#include "grib_ieeefloat.h" #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; @@ -344,7 +344,8 @@ double grib_long_to_ieee64(unsigned long x) return dval; } -int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val) +template <> +int grib_ieee_decode_array (grib_context* c, unsigned char* buf, size_t nvals, int bytes, double* val) { int err = 0, i = 0, j = 0; unsigned char s[8] = {0,}; @@ -387,7 +388,8 @@ int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, in return err; } -int grib_ieee_decode_array_float(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val) +template <> +int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, float* val) { int err = 0, i = 0, j = 0; unsigned char s[4] = {0,}; diff --git a/src/grib_ieeefloat.h b/src/grib_ieeefloat.h new file mode 100644 index 000000000..4967a6129 --- /dev/null +++ b/src/grib_ieeefloat.h @@ -0,0 +1,5 @@ +#pragma once + +#include "grib_api_internal.h" + +template int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, T* val); diff --git a/src/grib_value.cc b/src/grib_value.cc index 006ddca7f..55f435db1 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -12,6 +12,7 @@ * Enrico Fucile * ***************************************************************************/ #include "grib_api_internal.h" +#include "grib_value.h" #include /* Note: A fast cut-down version of strcmp which does NOT return -1 */ @@ -1279,10 +1280,11 @@ const char* grib_get_accessor_class_name(grib_handle* h, const char* name) return act ? act->cclass->name : NULL; } -static int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length) +template <> +int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length) { if (a) { - int err = _grib_get_double_array_internal(h, a->same, val, buffer_len, decoded_length); + int err = _grib_get_array_internal(h, a->same, val, buffer_len, decoded_length); if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; @@ -1297,10 +1299,11 @@ static int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* } } -int _grib_get_float_array_internal(const grib_handle* h, grib_accessor* a, float* val, size_t buffer_len, size_t* decoded_length) +template <> +int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, float* val, size_t buffer_len, size_t* decoded_length) { if (a) { - int err = _grib_get_float_array_internal(h, a->same, val, buffer_len, decoded_length); + int err = _grib_get_array_internal(h, a->same, val, buffer_len, decoded_length); if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; @@ -1317,28 +1320,35 @@ int _grib_get_float_array_internal(const grib_handle* h, grib_accessor* a, float int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length) { - int ret = grib_get_double_array(h, name, val, length); - - if (ret != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, - "unable to get %s as double array (%s)", - name, grib_get_error_message(ret)); - - return ret; + return grib_get_array_internal(h, name, val, length); } + int grib_get_float_array_internal(const grib_handle* h, const char* name, float* val, size_t* length) { - int ret = grib_get_float_array(h, name, val, length); + return grib_get_array_internal(h, name, val, length); +} - if (ret != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, - "unable to get %s as float array (%s)", - name, grib_get_error_message(ret)); +template <> +int grib_get_array(const grib_handle* h, const char* name, float* val, size_t *length) +{ + size_t len = *length; + grib_accessor* a = grib_find_accessor(h, name); + if (!a) return GRIB_NOT_FOUND; - return ret; + //[> TODO: For now only GRIB supported... no BUFR keys <] + if (h->product_kind != PRODUCT_GRIB) { + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_float_array only supported for GRIB"); + return GRIB_NOT_IMPLEMENTED; + } + Assert(name[0]!='/'); + Assert(name[0]!='#'); + *length = 0; + return _grib_get_array_internal(h,a,val,len,length); } -int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length) + +template <> +int grib_get_array(const grib_handle* h, const char* name, double* val, size_t* length) { size_t len = *length; grib_accessor* a = NULL; @@ -1358,31 +1368,23 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s if (!a) return GRIB_NOT_FOUND; if (name[0] == '#') { - return grib_unpack_double(a, val, length); + return grib_unpack_double(a, val, length); // TODO: change to template } else { *length = 0; - return _grib_get_double_array_internal(h, a, val, len, length); + return _grib_get_array_internal(h, a, val, len, length); } } } -// TODO(maee): ECC-1467: Copied the 'double' version and reused by copy/paste! -int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) +int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length) { - size_t len = *length; - grib_accessor* a = grib_find_accessor(h, name); - if (!a) return GRIB_NOT_FOUND; + return grib_get_array(h, name, val, length); +} - /* TODO: For now only GRIB supported... no BUFR keys */ - if (h->product_kind != PRODUCT_GRIB) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_float_array only supported for GRIB"); - return GRIB_NOT_IMPLEMENTED; - } - Assert(name[0]!='/'); - Assert(name[0]!='#'); - *length = 0; - return _grib_get_float_array_internal(h,a,val,len,length); +int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) +{ + return grib_get_array(h, name, val, length); } int ecc__grib_get_string_length(grib_accessor* a, size_t* size) diff --git a/src/grib_value.h b/src/grib_value.h new file mode 100644 index 000000000..147633423 --- /dev/null +++ b/src/grib_value.h @@ -0,0 +1,24 @@ +#pragma once + +#include "grib_api_internal.h" +#include +#include + +template +int grib_get_array(const grib_handle* h, const char* name, T* val, size_t* length); + +template +int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, T* val, size_t buffer_len, size_t* decoded_length); + +template +int grib_get_array_internal(const grib_handle* h, const char* name, T* val, size_t* length) +{ + int ret = grib_get_array(h, name, val, length); + + if (ret != GRIB_SUCCESS) + grib_context_log(h->context, GRIB_LOG_ERROR, + "unable to get %s as %s array (%s)", + name, typeid(T).name(), grib_get_error_message(ret)); + + return ret; +} From 067a3692eab56c8bf33ccadd762223d523617a8d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Feb 2023 14:11:19 +0000 Subject: [PATCH 106/212] Messages: Use ERROR rather than FATAL --- src/grib_accessor_class_global_gaussian.cc | 4 +-- ...essor_class_second_order_bits_per_value.cc | 2 +- src/grib_dumper_class_bufr_decode_C.cc | 2 +- src/grib_dumper_class_bufr_encode_C.cc | 4 +-- src/grib_dumper_class_bufr_encode_filter.cc | 4 +-- src/grib_dumper_class_bufr_encode_fortran.cc | 4 +-- src/grib_dumper_class_bufr_encode_python.cc | 4 +-- src/grib_dumper_class_bufr_simple.cc | 2 +- src/grib_dumper_class_default.cc | 4 +-- src/grib_dumper_class_json.cc | 4 +-- src/grib_dumper_class_wmo.cc | 4 +-- src/grib_handle.cc | 31 +++++++++---------- 12 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/grib_accessor_class_global_gaussian.cc b/src/grib_accessor_class_global_gaussian.cc index 37bd565a1..a63d0015e 100644 --- a/src/grib_accessor_class_global_gaussian.cc +++ b/src/grib_accessor_class_global_gaussian.cc @@ -324,8 +324,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) lats = (double*)grib_context_malloc(c, sizeof(double) * N * 2); if (!lats) { - grib_context_log(c, GRIB_LOG_FATAL, - "global_gaussian pack_long: Memory allocation error: %ld bytes", sizeof(double) * N * 2); + grib_context_log(c, GRIB_LOG_ERROR, + "global_gaussian pack_long: Memory allocation error: %zu bytes", sizeof(double) * N * 2); return GRIB_OUT_OF_MEMORY; } if ((ret = grib_get_gaussian_latitudes(N, lats)) != GRIB_SUCCESS) diff --git a/src/grib_accessor_class_second_order_bits_per_value.cc b/src/grib_accessor_class_second_order_bits_per_value.cc index eb0a5811d..edc5be20f 100644 --- a/src/grib_accessor_class_second_order_bits_per_value.cc +++ b/src/grib_accessor_class_second_order_bits_per_value.cc @@ -236,7 +236,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) values = (double*)grib_context_malloc_clear(a->context, sizeof(double) * size); if (!values) { - grib_context_log(a->context, GRIB_LOG_FATAL, "%s: Memory allocation error: %zu bytes", a->name, size); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Memory allocation error: %zu bytes", a->name, size); return GRIB_OUT_OF_MEMORY; } if ((ret = grib_get_double_array_internal(grib_handle_of_accessor(a), self->values, values, &size)) != GRIB_SUCCESS) diff --git a/src/grib_dumper_class_bufr_decode_C.cc b/src/grib_dumper_class_bufr_decode_C.cc index f02070d8e..e658a29ba 100644 --- a/src/grib_dumper_class_bufr_decode_C.cc +++ b/src/grib_dumper_class_bufr_decode_C.cc @@ -489,7 +489,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm self->empty = 0; values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } diff --git a/src/grib_dumper_class_bufr_encode_C.cc b/src/grib_dumper_class_bufr_encode_C.cc index 5c915049f..385474470 100644 --- a/src/grib_dumper_class_bufr_encode_C.cc +++ b/src/grib_dumper_class_bufr_encode_C.cc @@ -621,7 +621,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm self->empty = 0; values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } @@ -682,7 +682,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } diff --git a/src/grib_dumper_class_bufr_encode_filter.cc b/src/grib_dumper_class_bufr_encode_filter.cc index de3db03ca..308d5f7b4 100644 --- a/src/grib_dumper_class_bufr_encode_filter.cc +++ b/src/grib_dumper_class_bufr_encode_filter.cc @@ -557,7 +557,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } @@ -615,7 +615,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } diff --git a/src/grib_dumper_class_bufr_encode_fortran.cc b/src/grib_dumper_class_bufr_encode_fortran.cc index 2c722a50c..5596718c6 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.cc +++ b/src/grib_dumper_class_bufr_encode_fortran.cc @@ -672,7 +672,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } @@ -731,7 +731,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } diff --git a/src/grib_dumper_class_bufr_encode_python.cc b/src/grib_dumper_class_bufr_encode_python.cc index f7344acdb..53c9a9352 100644 --- a/src/grib_dumper_class_bufr_encode_python.cc +++ b/src/grib_dumper_class_bufr_encode_python.cc @@ -614,7 +614,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } @@ -672,7 +672,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } diff --git a/src/grib_dumper_class_bufr_simple.cc b/src/grib_dumper_class_bufr_simple.cc index 2759c20f5..19094f7c7 100644 --- a/src/grib_dumper_class_bufr_simple.cc +++ b/src/grib_dumper_class_bufr_simple.cc @@ -572,7 +572,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } diff --git a/src/grib_dumper_class_default.cc b/src/grib_dumper_class_default.cc index 53652da8c..0b64ce88a 100644 --- a/src/grib_dumper_class_default.cc +++ b/src/grib_dumper_class_default.cc @@ -350,7 +350,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } @@ -416,7 +416,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) value = (char*)grib_context_malloc_clear(c, size); if (!value) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } diff --git a/src/grib_dumper_class_json.cc b/src/grib_dumper_class_json.cc index b0f43bd10..7ccf07f7f 100644 --- a/src/grib_dumper_class_json.cc +++ b/src/grib_dumper_class_json.cc @@ -397,7 +397,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "Memory allocation error: %zu bytes", size); + grib_context_log(c, GRIB_LOG_ERROR, "Memory allocation error: %zu bytes", size); return; } @@ -458,7 +458,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) * if (size==0) return; * value=(char*)grib_context_malloc_clear(a->context,size); * if (!value) { - * grib_context_log(a->context,GRIB_LOG_FATAL,"unable to allocate %d bytes",(int)size); + * grib_context_log(a->context,GRIB_LOG_ERROR,"unable to allocate %d bytes",(int)size); * return; * } */ diff --git a/src/grib_dumper_class_wmo.cc b/src/grib_dumper_class_wmo.cc index f896d04aa..86270e0b2 100644 --- a/src/grib_dumper_class_wmo.cc +++ b/src/grib_dumper_class_wmo.cc @@ -308,7 +308,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) ecc__grib_get_string_length(a, &size); value = (char*)grib_context_malloc_clear(a->context, size); if (!value) { - grib_context_log(a->context, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(a->context, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } err = grib_unpack_string(a, value, &size); @@ -630,7 +630,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm values = (char**)grib_context_malloc_clear(c, size * sizeof(char*)); if (!values) { - grib_context_log(c, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); return; } diff --git a/src/grib_handle.cc b/src/grib_handle.cc index 2b152d846..931bdd6ea 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -9,9 +9,8 @@ */ /*************************************************************************** - * Jean Baptiste Filippi - 01.11.2005 - * Enrico Fucile - * * + * Jean Baptiste Filippi - 01.11.2005 * + * Enrico Fucile * ***************************************************************************/ #include "grib_api_internal.h" @@ -1375,25 +1374,25 @@ int codes_check_message_footer(const void* bytes, size_t length, ProductKind pro int grib_get_message_size(const grib_handle* ch, size_t* size) { long totalLength = 0; - int ret = 0; + int err = 0; grib_handle* h = (grib_handle*)ch; *size = h->buffer->ulength; - ret = grib_get_long(h, "totalLength", &totalLength); - if (!ret) + err = grib_get_long(h, "totalLength", &totalLength); + if (!err) *size = totalLength; - return ret; + return err; } int grib_get_message(const grib_handle* ch, const void** msg, size_t* size) { long totalLength = 0; - int ret = 0; + int err = 0; grib_handle* h = (grib_handle*)ch; *msg = h->buffer->data; *size = h->buffer->ulength; - ret = grib_get_long(h, "totalLength", &totalLength); - if (!ret) + err = grib_get_long(h, "totalLength", &totalLength); + if (!err) *size = totalLength; if (h->context->gts_header_on && h->gts_header) { @@ -1406,20 +1405,20 @@ int grib_get_message(const grib_handle* ch, const void** msg, size_t* size) int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size) { - int ret = 0; + int err = 0; size_t endOfHeadersMarker; *msg = h->buffer->data; *size = h->buffer->ulength; - if ((ret = grib_get_offset(h, "endOfHeadersMarker", &endOfHeadersMarker)) != GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_FATAL, - "grib_get_message_headers unable to get offset of endOfHeadersMarker"); - return ret; + if ((err = grib_get_offset(h, "endOfHeadersMarker", &endOfHeadersMarker)) != GRIB_SUCCESS) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "grib_get_message_headers: unable to get offset of endOfHeadersMarker"); + return err; } *size = endOfHeadersMarker; - return ret; + return err; } grib_handle* grib_handle_new(grib_context* c) From f3fe51ab6ad6da1eb90fb66db8de5c062db72b8e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Feb 2023 16:51:21 +0000 Subject: [PATCH 107/212] Testing: Add test for codes_get_message_copy --- tests/CMakeLists.txt | 2 ++ tests/grib_copy_message.cc | 57 ++++++++++++++++++++++++++++++++++++++ tests/grib_copy_message.sh | 23 +++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 tests/grib_copy_message.cc create mode 100755 tests/grib_copy_message.sh diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 867b18a9a..589278ec8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,6 +44,7 @@ list(APPEND test_c_bins grib_sh_ieee64 grib_ieee grib_set_bytes + grib_copy_message grib_packing_order grib_sh_imag grib_sh_spectral_complex @@ -239,6 +240,7 @@ if( HAVE_BUILD_TOOLS ) grib_grid_mercator grib_global grib_concept + grib_copy_message grib_decimalPrecision grib_bitsPerValue grib_get_fail diff --git a/tests/grib_copy_message.cc b/tests/grib_copy_message.cc new file mode 100644 index 000000000..0fd6bb021 --- /dev/null +++ b/tests/grib_copy_message.cc @@ -0,0 +1,57 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ +#include +#undef NDEBUG +#include +#include "eccodes.h" + +int main(int argc, char* argv[]) +{ + FILE* in = NULL; + codes_handle* source_handle = NULL; + int err = 0; + size_t totalLength = 0, size = 0; + unsigned char* buffer = NULL; + codes_handle* new_handle = NULL; + + assert (argc == 3); + + in = fopen(argv[1], "rb"); + assert(in); + + source_handle = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); + assert(source_handle); + + // How big is the input GRIB message? + CODES_CHECK(codes_get_message_size(source_handle, &totalLength), 0); + + // Allocate a buffer large enough to hold the message + buffer = (unsigned char*)malloc(totalLength); + size = totalLength; + + // Take a copy of the message into buffer. Now we own it + CODES_CHECK(codes_get_message_copy(source_handle, buffer, &size), 0); + assert(size == totalLength); + codes_handle_delete(source_handle); + + // Now buffer contains a copy of the message + new_handle = codes_handle_new_from_message(0, buffer, totalLength); + assert(new_handle); + + // Change something and write it out + CODES_CHECK(codes_set_long(new_handle, "hour", 18), 0); + CODES_CHECK(codes_write_message(new_handle, argv[2], "w"), 0); + codes_handle_delete(new_handle); + free(buffer); + + fclose(in); + + return 0; +} diff --git a/tests/grib_copy_message.sh b/tests/grib_copy_message.sh new file mode 100755 index 000000000..4d0786340 --- /dev/null +++ b/tests/grib_copy_message.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +label="grib_copy_message_test" +temp=temp.$label.grib + +infile=$data_dir/sample.grib2 +$EXEC ${test_dir}/grib_copy_message $infile $temp + +# The hour key was changed but nothing else +${tools_dir}/grib_compare -b hour $infile $temp + +# Clean up test outputs +rm -f $temp From a03b6ecb2c3122ed4bbfa4604268aeba748beb37 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 20 Feb 2023 18:06:56 +0000 Subject: [PATCH 108/212] Testing: Sanity test for CCSDS --- tests/grib_ccsds.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/grib_ccsds.sh b/tests/grib_ccsds.sh index 36446471e..1c53ed5a2 100755 --- a/tests/grib_ccsds.sh +++ b/tests/grib_ccsds.sh @@ -21,6 +21,11 @@ outfile2=temp.$label.2 rm -f $outfile1 $outfile2 +# Convert a non-constant grib2 file (Note: not using -r) +grib2_sample=$ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl +${tools_dir}/grib_set -s packingType=grid_ccsds $grib2_sample $outfile1 +${tools_dir}/grib_compare -c data:n $grib2_sample $outfile1 + # ECC-1263 # --------- From 72ca0a62105ddbcb22627f7d3283f06ccb865897 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 22 Feb 2023 14:13:08 +0000 Subject: [PATCH 109/212] ECC-1533: GRIB: Add multithreading config to JasPer --- src/grib_jasper_encoding.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/grib_jasper_encoding.cc b/src/grib_jasper_encoding.cc index 609991a0a..815fe376b 100644 --- a/src/grib_jasper_encoding.cc +++ b/src/grib_jasper_encoding.cc @@ -26,6 +26,11 @@ static int ecc_jasper_initialise() int jaserr = 0; jas_conf_clear(); jas_conf_set_max_mem_usage(jas_get_total_mem_size()); + + #if defined GRIB_PTHREADS || defined GRIB_OMP_THREADS + jas_conf_set_multithread(1); + #endif + jaserr = jas_init_library(); if (jaserr) return jaserr; jaserr = jas_init_thread(); From db4c949eca59e882129b17f9a776ac4b68bd582a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 22 Feb 2023 17:44:02 +0000 Subject: [PATCH 110/212] ECC-1532: GRIB: Implement feature/carra_expver --- tests/grib_uerra.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/grib_uerra.sh b/tests/grib_uerra.sh index a0b827cbf..cdd7beb87 100755 --- a/tests/grib_uerra.sh +++ b/tests/grib_uerra.sh @@ -73,5 +73,23 @@ status=$? set -e [ $status -ne 0 ] +# ECC-1532 +# --------- +# By default crraLocalVersion=1 which does not allow expver to be set +# because it is a constant (prod or test) +set +e +${tools_dir}/grib_set -s \ + productionStatusOfProcessedData=10,grib2LocalSectionPresent=1,marsExpver=coco \ +$grib2_sample $temp1 +status=$? +set -e +[ $status -ne 0 ] + +# crraLocalVersion=2 has a coded key which can be set +${tools_dir}/grib_set -s \ + productionStatusOfProcessedData=10,grib2LocalSectionPresent=1,crraLocalVersion=2,marsExpver=coco \ +$grib2_sample $temp1 +grib_check_key_equals $temp1 'marsExpver,mars.expver' 'coco coco' + # Clean up rm -f $temp1 $temp2 $tempSample From 98ddb38ce14d9631f3718d52f5082821d1a402b8 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Feb 2023 15:03:11 +0000 Subject: [PATCH 111/212] ECC-1534: Remove the GRIB1 key 'mybits' --- definitions/grib1/section.1.def | 2 -- 1 file changed, 2 deletions(-) diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index 25829af6c..7604b56df 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -137,8 +137,6 @@ codetable[1] timeRangeIndicator ('5.table',tablesLocalDir,tablesMasterDir) = 1 : unsigned[2] numberIncludedInAverage; -meta mybits bits(numberIncludedInAverage,0,12); - unsigned[1] numberMissingFromAveragesOrAccumulations; unsigned[1] centuryOfReferenceTimeOfData; From cdba8c8e3858863931220df91d3b58f9b00761d7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Feb 2023 20:37:29 +0000 Subject: [PATCH 112/212] Testing: Constant fields and 2nd order packing --- tests/grib_second_order.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/grib_second_order.sh b/tests/grib_second_order.sh index bc41a47be..dfe245e46 100755 --- a/tests/grib_second_order.sh +++ b/tests/grib_second_order.sh @@ -169,6 +169,14 @@ grib_check_key_equals $infile packingType grid_second_order ${tools_dir}/grib_set -d1 $infile $temp1 grib_check_key_equals $temp1 packingType grid_simple +infile=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +${tools_dir}/grib_set -r -s packingType=grid_second_order $infile $temp1 +grib_check_key_equals $temp1 packingType grid_simple + +infile=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +${tools_dir}/grib_set -r -s packingType=grid_second_order $infile $temp1 +grib_check_key_equals $temp1 packingType grid_simple + # Clean up rm -f $temp_stat1 $temp_stat2 From 15ea2a4708b1c6853d8c550fd235fdf23f0851ab Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 24 Feb 2023 13:36:10 +0000 Subject: [PATCH 113/212] ECC-1532: GRIB: Allow setting 'expver' on CARRA/CERRA data --- definitions/grib2/products_11.def | 6 ++++-- tests/grib_uerra.sh | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/definitions/grib2/products_11.def b/definitions/grib2/products_11.def index 6084a0b37..bad30182a 100644 --- a/definitions/grib2/products_11.def +++ b/definitions/grib2/products_11.def @@ -1,5 +1,7 @@ # (C) Copyright 2005- ECMWF. -# Copernicus regional reanalysis (CARRA/CERRA) -constant marsExpver = 'test'; +# Copernicus regional reanalysis test (CARRA/CERRA) +if (!defined(marsExpver)) { + constant marsExpver = 'test'; +} include "grib2/products_crra.def" diff --git a/tests/grib_uerra.sh b/tests/grib_uerra.sh index cdd7beb87..15f9523e6 100755 --- a/tests/grib_uerra.sh +++ b/tests/grib_uerra.sh @@ -85,11 +85,18 @@ status=$? set -e [ $status -ne 0 ] -# crraLocalVersion=2 has a coded key which can be set +# ECC-1532 +# crraLocalVersion=2 has a coded key for experimentVersionNumber ${tools_dir}/grib_set -s \ productionStatusOfProcessedData=10,grib2LocalSectionPresent=1,crraLocalVersion=2,marsExpver=coco \ $grib2_sample $temp1 grib_check_key_equals $temp1 'marsExpver,mars.expver' 'coco coco' +${tools_dir}/grib_set -s \ + productionStatusOfProcessedData=11,grib2LocalSectionPresent=1,crraLocalVersion=2,experimentVersionNumber=0078 \ +$grib2_sample $temp1 +grib_check_key_equals $temp1 'marsExpver,mars.expver' '0078 0078' + + # Clean up rm -f $temp1 $temp2 $tempSample From d8b26817dfc1f6aea387de3585cfd601bee9c9b0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 26 Feb 2023 12:44:43 +0000 Subject: [PATCH 114/212] Testing: Remove unused ref files from downloads --- data/bufr/bufr_ref_files.txt | 104 ----------------------------------- 1 file changed, 104 deletions(-) diff --git a/data/bufr/bufr_ref_files.txt b/data/bufr/bufr_ref_files.txt index c1897eb28..da11a3001 100644 --- a/data/bufr/bufr_ref_files.txt +++ b/data/bufr/bufr_ref_files.txt @@ -262,110 +262,6 @@ synop_multi_subset.bufr.desc.ref aaen_55.bufr.ls.ref syno_multi.bufr.header.ref 207003.bufr.json.ref -new_207003.bufr.ref -new_aaen_55.bufr.ref -new_aben_55.bufr.ref -new_ahws_139.bufr.ref -new_airc_142.bufr.ref -new_airc_144.bufr.ref -new_airs_57.bufr.ref -new_alws_139.bufr.ref -new_amda_144.bufr.ref -new_amsa_55.bufr.ref -new_amsb_55.bufr.ref -new_amse_55.bufr.ref -new_amsu_55.bufr.ref -new_amv2_87.bufr.ref -new_amv3_87.bufr.ref -new_asbh_139.bufr.ref -new_asbl_139.bufr.ref -new_asca_139.bufr.ref -new_asch_139.bufr.ref -new_ascs_139.bufr.ref -new_aseh_139.bufr.ref -new_asel_139.bufr.ref -new_ashs_139.bufr.ref -new_atap_55.bufr.ref -new_ateu_155.bufr.ref -new_atms_201.bufr.ref -new_atov_55.bufr.ref -new_avhm_87.bufr.ref -new_avhn_87.bufr.ref -new_avhr_58.bufr.ref -new_b002_95.bufr.ref -new_b002_96.bufr.ref -new_b003_56.bufr.ref -new_b004_145.bufr.ref -new_b005_87.bufr.ref -new_b006_96.bufr.ref -new_b007_31.bufr.ref -new_bssh_170.bufr.ref -new_bssh_176.bufr.ref -new_bssh_178.bufr.ref -new_bssh_180.bufr.ref -new_btem_109.bufr.ref -new_buoy_27.bufr.ref -new_cmwi_87.bufr.ref -new_cmwn_87.bufr.ref -new_cnow_28.bufr.ref -new_cori_156.bufr.ref -new_crit_202.bufr.ref -new_emsg_87.bufr.ref -new_euwv_87.bufr.ref -new_fy3a_154.bufr.ref -new_fy3b_154.bufr.ref -new_go15_87.bufr.ref -new_goee_87.bufr.ref -new_goes_87.bufr.ref -new_grst_26.bufr.ref -new_gst4_26.bufr.ref -new_hirb_55.bufr.ref -new_hirs_55.bufr.ref -new_ias1_240.bufr.ref -new_iasi_241.bufr.ref -new_itwt_233.bufr.ref -new_j2eo_216.bufr.ref -new_j2nb_216.bufr.ref -new_jaso_214.bufr.ref -new_meta_140.bufr.ref -new_mhen_55.bufr.ref -new_mhsa_55.bufr.ref -new_mhsb_55.bufr.ref -new_mhse_55.bufr.ref -new_modi_87.bufr.ref -new_modw_87.bufr.ref -new_monw_87.bufr.ref -new_mytemp.bufr.ref -new_new.bufr.ref -new_ocea_131.bufr.ref -new_ocea_132.bufr.ref -new_ocea_133.bufr.ref -new_ocea_21.bufr.ref -new_pgps_110.bufr.ref -new_pilo_91.bufr.ref -new_s4kn_165.bufr.ref -new_ship_13.bufr.ref -new_ship_19.bufr.ref -new_ship_9.bufr.ref -new_smin_49.bufr.ref -new_smis_49.bufr.ref -new_smiu_49.bufr.ref -new_smos_203.bufr.ref -new_sn4k_165.bufr.ref -new_soil_7.bufr.ref -new_ssbt_127.bufr.ref -new_stuk_7.bufr.ref -new_syno_1.bufr.ref -new_syno_3.bufr.ref -new_syno_4.bufr.ref -new_syno_multi.bufr.ref -new_synop_multi_subset.bufr.ref -new_temp_101.bufr.ref -new_temp_102.bufr.ref -new_temp_106.bufr.ref -new_tmr7_129.bufr.ref -new_tros_31.bufr.ref -new_wavb_134.bufr.ref 311001.bufr.ref uegabe.bufr.num.ref syno.bufr.out.ref From 50138bd42b8792697bb70f247925c1faeba8ddae Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 26 Feb 2023 15:07:26 +0000 Subject: [PATCH 115/212] ECC-1536: Testing: Speed up the BUFR downloads by running them in parallel --- data/bufr/CMakeLists.txt | 13 +++++++++---- examples/C/CMakeLists.txt | 2 +- examples/F90/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/data/bufr/CMakeLists.txt b/data/bufr/CMakeLists.txt index 148500ed9..786cf27b5 100644 --- a/data/bufr/CMakeLists.txt +++ b/data/bufr/CMakeLists.txt @@ -12,13 +12,18 @@ file(READ "bufr_ref_files.txt" bufr_refs_to_download) string(REGEX REPLACE "\n" ";" bufr_refs_to_download "${bufr_refs_to_download}") # Exceptional case: download bufr files which have to be treated specially -list(APPEND bufr_refs_to_download "vos308014_v3_26.bufr") # See test ecc-197 +list(APPEND bufr_files_to_download "vos308014_v3_26.bufr") # See test ecc-197 if( ENABLE_EXTRA_TESTS ) ecbuild_get_test_multidata( - TARGET eccodes_download_bufrs - NOCHECK - NAMES ${bufr_files_to_download} ${bufr_refs_to_download} + TARGET eccodes_download_bufrs + NOCHECK + NAMES ${bufr_files_to_download} + ) + ecbuild_get_test_multidata( + TARGET eccodes_download_bufr_refs + NOCHECK + NAMES ${bufr_refs_to_download} ) endif() diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index bafdb2dfc..539077c2b 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -148,7 +148,7 @@ foreach( test ${tests_extra} ) TYPE SCRIPT CONDITION ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh - TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs ) + TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs eccodes_download_bufr_refs ) endforeach() # Tests which are conditional diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index ce522de09..5734358db 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -115,7 +115,7 @@ foreach( tool ${tests_extra} ) CONDITION HAVE_FORTRAN AND ENABLE_EXTRA_TESTS RESOURCES bufr_read_scatterometer_f.ref COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh - TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs ) + TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs eccodes_download_bufr_refs ) endforeach() # Test for CCSDS (AEC) packing diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 589278ec8..7ed14fbd0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -313,7 +313,8 @@ if( HAVE_BUILD_TOOLS ) COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh RESOURCES asca_139.t1.ref TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs - eccodes_download_bufrs eccodes_download_metars eccodes_download_gts ) + eccodes_download_bufrs eccodes_download_bufr_refs + eccodes_download_metars eccodes_download_gts ) endforeach() if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS ) @@ -350,7 +351,7 @@ if( HAVE_BUILD_TOOLS ) TYPE SCRIPT CONDITION NOT ECCODES_ON_WINDOWS AND ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_ecc-1288.sh - TEST_DEPENDS eccodes_download_bufrs ) + TEST_DEPENDS eccodes_download_bufrs eccodes_download_bufr_refs ) if( ENABLE_EXTRA_TESTS AND HAVE_ECCODES_THREADS ) From 6d49930616d430a9cb1bda08b0ef5271b7349200 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 27 Feb 2023 10:32:58 +0000 Subject: [PATCH 116/212] Testing: Ensure tests pass with -DENABLE_BUILD_TOOLS=0 --- examples/C/grib_set_missing.sh | 10 ++++++---- examples/F90/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/C/grib_set_missing.sh b/examples/C/grib_set_missing.sh index 1be3f5a8f..baef5d073 100755 --- a/examples/C/grib_set_missing.sh +++ b/examples/C/grib_set_missing.sh @@ -15,9 +15,11 @@ tempGrib="out_surface_level.grib2" ${examples_dir}/c_grib_set_missing # Check the keys have been set to MISSING -sf=`${tools_dir}/grib_get -p scaleFactorOfFirstFixedSurface $tempGrib` -[ "$sf" = "MISSING" ] -sf=`${tools_dir}/grib_get -p scaledValueOfFirstFixedSurface $tempGrib` -[ "$sf" = "MISSING" ] +if [ -f "${tools_dir}/grib_get" ]; then + sf=`${tools_dir}/grib_get -p scaleFactorOfFirstFixedSurface $tempGrib` + [ "$sf" = "MISSING" ] + sf=`${tools_dir}/grib_get -p scaledValueOfFirstFixedSurface $tempGrib` + [ "$sf" = "MISSING" ] +fi rm -f $tempGrib diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 5734358db..11087151c 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -123,7 +123,7 @@ ecbuild_add_test( TARGET eccodes_f_grib_set_packing SOURCES grib_set_packing.f90 LINKER_LANGUAGE Fortran LIBS eccodes_f90 eccodes - CONDITION HAVE_AEC AND HAVE_FORTRAN + CONDITION HAVE_BUILD_TOOLS AND HAVE_AEC AND HAVE_FORTRAN COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_set_packing.sh ) # Executables without a shell script From 7122fed43ee2159e3937974ce2d644c362b17b23 Mon Sep 17 00:00:00 2001 From: Daniel Tipping Date: Mon, 27 Feb 2023 15:25:39 +0000 Subject: [PATCH 117/212] Add GitHub Action to sync to Bitbucket --- .github/workflows/sync.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 000000000..983103941 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,24 @@ +name: sync + +# Controls when the workflow will run +on: + # Trigger the workflow on all pushes + push: + branches: + - "**" + tags: + - "**" + + # Trigger the workflow when a branch or tag is deleted + delete: ~ + +jobs: + # Calls a reusable CI workflow to sync the current with a remote repository. + # It will correctly handle addition of any new and removal of existing Git objects. + sync: + name: sync + uses: ecmwf-actions/reusable-workflows/.github/workflows/sync.yml@v2 + secrets: + target_repository: eccodes/eccodes + target_username: ClonedDuck + target_token: ${{ secrets.BITBUCKET_PAT }} From b1f58565ed1e24b772dc38576fceb69d247008ef Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 1 Mar 2023 13:06:41 +0000 Subject: [PATCH 118/212] ECC-1467: template for second order packing --- src/grib_accessor_class_data_ccsds_packing.h | 230 ++++---- ...grib_accessor_class_data_complex_packing.h | 4 +- ...ib_accessor_class_data_g22order_packing.cc | 551 +----------------- ...rib_accessor_class_data_g22order_packing.h | 293 ++++++++++ 4 files changed, 421 insertions(+), 657 deletions(-) create mode 100644 src/grib_accessor_class_data_g22order_packing.h diff --git a/src/grib_accessor_class_data_ccsds_packing.h b/src/grib_accessor_class_data_ccsds_packing.h index 95169eb8a..75b13ac29 100644 --- a/src/grib_accessor_class_data_ccsds_packing.h +++ b/src/grib_accessor_class_data_ccsds_packing.h @@ -7,8 +7,7 @@ const char* aec_get_error_message(int code); void print_aec_stream_info(struct aec_stream* strm, const char* func); #endif -//static int unpack_double(grib_accessor*, double* val, size_t* len); -//static int unpack_float(grib_accessor*, float* val, size_t* len); +void print_error_feature_not_enabled(grib_context* c); typedef struct grib_accessor_data_ccsds_packing { @@ -36,125 +35,126 @@ typedef struct grib_accessor_data_ccsds_packing template class GribAccessorDataCcsdsPacking { public: + static int unpack(grib_accessor* a, T* val, size_t* len); +}; #if defined(HAVE_LIBAEC) || defined(HAVE_AEC) - static int unpack(grib_accessor* a, T* val, size_t* len) - { - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - int err = GRIB_SUCCESS, i = 0; - size_t buflen = 0; - struct aec_stream strm; - double bscale = 0; - double dscale = 0; - unsigned char* buf = NULL; - size_t n_vals = 0; - size_t size = 0; - unsigned char* decoded = NULL; - /*unsigned char* p = NULL;*/ - long pos = 0; - long nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - long bits8; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - - self->dirty = 0; - - if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) - return err; - n_vals = nn; - - if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - - /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) - return err; - - /* TODO: This should be called upstream */ - if (*len < n_vals) - return GRIB_ARRAY_TOO_SMALL; - - /* Special case */ - if (bits_per_value == 0) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - bscale = grib_power(binary_scale_factor, 2); - dscale = grib_power(-decimal_scale_factor, 10); - - buflen = grib_byte_count(a); - buf = (unsigned char*)hand->buffer->data; - buf += grib_byte_offset(a); - - strm.flags = ccsds_flags; - strm.bits_per_sample = bits_per_value; - strm.block_size = ccsds_block_size; - strm.rsi = ccsds_rsi; - - strm.next_in = buf; - strm.avail_in = buflen; - - bits8 = ((bits_per_value + 7) / 8) * 8; - size = n_vals * ((bits_per_value + 7) / 8); - decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); - if (!decoded) { - err = GRIB_OUT_OF_MEMORY; - goto cleanup; - } - strm.next_out = decoded; - strm.avail_out = size; - - if (hand->context->debug) print_aec_stream_info(&strm, "unpack_*"); - - if ((err = aec_buffer_decode(&strm)) != AEC_OK) { - grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS %s: aec_buffer_decode error %d (%s)\n", - __PRETTY_FUNCTION__, err, aec_get_error_message(err)); - err = GRIB_ENCODING_ERROR; - goto cleanup; - } - - pos = 0; - - /* ECC-1427: Performance improvement */ - //grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - *len = n_vals; +template +int GribAccessorDataCcsdsPacking::unpack(grib_accessor* a, T* val, size_t* len) +{ + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + int err = GRIB_SUCCESS, i = 0; + size_t buflen = 0; + struct aec_stream strm; + double bscale = 0; + double dscale = 0; + unsigned char* buf = NULL; + size_t n_vals = 0; + size_t size = 0; + unsigned char* decoded = NULL; + /*unsigned char* p = NULL;*/ + long pos = 0; + long nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + long bits8; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + + self->dirty = 0; + + if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + return err; + n_vals = nn; + + if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + + /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) + return err; - cleanup: - grib_context_buffer_free(a->context, decoded); + if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) return err; + if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) + return err; + + /* TODO: This should be called upstream */ + if (*len < n_vals) + return GRIB_ARRAY_TOO_SMALL; + + /* Special case */ + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; } -#else - static int unpack(grib_accessor* a, float* val, size_t* len) - { - print_error_feature_not_enabled(a->context); - return GRIB_FUNCTIONALITY_NOT_ENABLED; + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); + + buflen = grib_byte_count(a); + buf = (unsigned char*)hand->buffer->data; + buf += grib_byte_offset(a); + +strm.flags = ccsds_flags; +strm.bits_per_sample = bits_per_value; +strm.block_size = ccsds_block_size; +strm.rsi = ccsds_rsi; + +strm.next_in = buf; +strm.avail_in = buflen; + + bits8 = ((bits_per_value + 7) / 8) * 8; + size = n_vals * ((bits_per_value + 7) / 8); + decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); + if (!decoded) { + err = GRIB_OUT_OF_MEMORY; + goto cleanup; } -#endif + strm.next_out = decoded; + strm.avail_out = size; -}; + if (hand->context->debug) print_aec_stream_info(&strm, "unpack_*"); + + if ((err = aec_buffer_decode(&strm)) != AEC_OK) { + grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS %s: aec_buffer_decode error %d (%s)\n", + __PRETTY_FUNCTION__, err, aec_get_error_message(err)); + err = GRIB_ENCODING_ERROR; + goto cleanup; +} +pos = 0; + +/* ECC-1427: Performance improvement */ +//grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + *len = n_vals; + +cleanup: + grib_context_buffer_free(a->context, decoded); + return err; +} + +#else +template +int GribAccessorDataCcsdsPacking::unpack(grib_accessor* a, T* val, size_t* len) +{ + print_error_feature_not_enabled(a->context); + return GRIB_FUNCTIONALITY_NOT_ENABLED; +} +#endif diff --git a/src/grib_accessor_class_data_complex_packing.h b/src/grib_accessor_class_data_complex_packing.h index 52cf64893..be7b7287f 100644 --- a/src/grib_accessor_class_data_complex_packing.h +++ b/src/grib_accessor_class_data_complex_packing.h @@ -1,5 +1,3 @@ -// ECC-1467 - #pragma once #include "grib_api_internal_cpp.h" @@ -49,7 +47,7 @@ class GribAccessorClassDataComplexPacking { static int unpack(grib_accessor* a, T* val, size_t* len); }; - +// ECC-1467: FloatDataValues template int GribAccessorClassDataComplexPacking::unpack(grib_accessor* a, T* val, size_t* len) { diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index 832172df6..a4dbd89ff 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -8,7 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" + +#include "grib_accessor_class_data_g22order_packing.h" /* This is used by make_class.pl @@ -56,45 +57,12 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -static int unpack_double(grib_accessor*, double* val, size_t* len); -static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int unpack_double_element(grib_accessor*, size_t i, double* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); -typedef struct grib_accessor_data_g22order_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; - /* Members defined in data_g22order_packing */ - const char* numberOfValues; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* typeOfOriginalFieldValues; - const char* groupSplittingMethodUsed; - const char* missingValueManagementUsed; - const char* primaryMissingValueSubstitute; - const char* secondaryMissingValueSubstitute; - const char* numberOfGroupsOfDataValues; - const char* referenceForGroupWidths; - const char* numberOfBitsUsedForTheGroupWidths; - const char* referenceForGroupLengths; - const char* lengthIncrementForTheGroupLengths; - const char* trueLengthOfLastGroup; - const char* numberOfBitsUsedForTheScaledGroupLengths; - const char* orderOfSpatialDifferencing; - const char* numberOfOctetsExtraDescriptors; -} grib_accessor_data_g22order_packing; extern grib_accessor_class* grib_accessor_class_values; @@ -121,8 +89,8 @@ static grib_accessor_class _grib_accessor_class_data_g22order_packing = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &unpack_double, /* grib_unpack procedures double */ - &unpack_float, /* grib_unpack procedures float */ + &GribAccessorDataG22orderPacking::unpack, /* grib_unpack procedures double */ + &GribAccessorDataG22orderPacking::unpack, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -354,7 +322,7 @@ static int spatial_difference (grib_context *c, unsigned long* vals, long len, } #endif -static int post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]) +int post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]) { unsigned long last, penultimate, j = 0; Assert(order > 0); @@ -455,501 +423,6 @@ static int de_spatial_difference (grib_context *c, unsigned long* vals, long le } #endif -static int unpack_double(grib_accessor* a, double* val, size_t* len) -{ - grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; - - size_t i = 0; - size_t j = 0; - long n_vals = 0; - long vcount = 0; - int err = GRIB_SUCCESS; - - long* sec_val = NULL; - grib_handle* gh = grib_handle_of_accessor(a); - - unsigned char* buf = (unsigned char*)gh->buffer->data; - unsigned char* buf_ref = NULL; - unsigned char* buf_width = NULL; - unsigned char* buf_length = NULL; - unsigned char* buf_vals = NULL; - - long length_p = 0; - long ref_p = 0; - long width_p = 0; - long vals_p = 0; - - long nvals_per_group = 0; - long nbits_per_group_val = 0; - long group_ref_val = 0; - - long bits_per_value = 0; - double binary_s = 0; - double decimal_s = 0; - double reference_value = 0; - - long binary_scale_factor; - long decimal_scale_factor; - long typeOfOriginalFieldValues; - long groupSplittingMethodUsed; - long missingValueManagementUsed; - long primaryMissingValueSubstitute; - long secondaryMissingValueSubstitute; - long numberOfGroupsOfDataValues; - long referenceForGroupWidths; - long numberOfBitsUsedForTheGroupWidths; - long referenceForGroupLengths; - long lengthIncrementForTheGroupLengths; - long trueLengthOfLastGroup; - long numberOfBitsUsedForTheScaledGroupLengths; - long orderOfSpatialDifferencing; - long numberOfOctetsExtraDescriptors; - double missingValue = 0; - - err = grib_value_count(a, &n_vals); - if (err) - return err; - - if (*len < (size_t)n_vals) - return GRIB_ARRAY_TOO_SMALL; - - if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) - return err; - - /* Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) - return err; - - self->dirty = 0; - - sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); - if (!sec_val) - return GRIB_OUT_OF_MEMORY; - memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ - - buf_ref = buf + a->offset; - - ref_p = (numberOfGroupsOfDataValues * bits_per_value); - - if (orderOfSpatialDifferencing) - ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); - - buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); - - width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); - buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); - - length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); - buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); - - length_p = 0; - ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; - width_p = 0; - vals_p = 0; - vcount = 0; - - for (i = 0; i < numberOfGroupsOfDataValues; i++) { - group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); - nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); - nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); - - nvals_per_group *= lengthIncrementForTheGroupLengths; - nvals_per_group += referenceForGroupLengths; - nbits_per_group_val += referenceForGroupWidths; - - if (i == numberOfGroupsOfDataValues - 1) - nvals_per_group = trueLengthOfLastGroup; - Assert(n_vals >= vcount + nvals_per_group); - - /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, - &sec_val[vcount]); */ - if (missingValueManagementUsed == 0) { - /* No explicit missing values included within data values */ - for (j = 0; j < nvals_per_group; j++) { - DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); - sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ - } - } - else if (missingValueManagementUsed == 1) { - /* Primary missing values included within data values */ - long maxn = 0; /* (1 << bits_per_value) - 1; */ - for (j = 0; j < nvals_per_group; j++) { - if (nbits_per_group_val == 0) { - maxn = (1 << bits_per_value) - 1; - if (group_ref_val == maxn) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount + j] = group_ref_val + temp; - } - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - if (temp == maxn) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - sec_val[vcount + j] = group_ref_val + temp; - } - } - } - } - else if (missingValueManagementUsed == 2) { - /* Primary and secondary missing values included within data values */ - long maxn = (1 << bits_per_value) - 1; - long maxn2 = 0; /* maxn - 1; */ - for (j = 0; j < nvals_per_group; j++) { - if (nbits_per_group_val == 0) { - maxn2 = maxn - 1; - if (group_ref_val == maxn || group_ref_val == maxn2) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount + j] = group_ref_val + temp; - } - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - maxn2 = maxn - 1; - if (temp == maxn || temp == maxn2) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - sec_val[vcount + j] = group_ref_val + temp; - } - } - } - } - - vcount += nvals_per_group; - } - - if (orderOfSpatialDifferencing) { - long bias = 0; - unsigned long extras[2] = {0,}; - ref_p = 0; - - /* For Complex packing, order == 0 */ - /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ - if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); - return GRIB_INTERNAL_ERROR; - } - - for (i = 0; i < orderOfSpatialDifferencing; i++) { - extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); - } - - bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); - - post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); - /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ - } - - binary_s = grib_power(binary_scale_factor, 2); - decimal_s = grib_power(-decimal_scale_factor, 10); - - for (i = 0; i < n_vals; i++) { - if (sec_val[i] == LONG_MAX) { - val[i] = missingValue; - } - else { - val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; - } - } - - grib_context_free(a->context, sec_val); - return err; -} - -static int unpack_float(grib_accessor* a, float* val, size_t* len) -{ - grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; - - size_t i = 0; - size_t j = 0; - long n_vals = 0; - long vcount = 0; - int err = GRIB_SUCCESS; - - long* sec_val = NULL; - grib_handle* gh = grib_handle_of_accessor(a); - - unsigned char* buf = (unsigned char*)gh->buffer->data; - unsigned char* buf_ref = NULL; - unsigned char* buf_width = NULL; - unsigned char* buf_length = NULL; - unsigned char* buf_vals = NULL; - - long length_p = 0; - long ref_p = 0; - long width_p = 0; - long vals_p = 0; - - long nvals_per_group = 0; - long nbits_per_group_val = 0; - long group_ref_val = 0; - - long bits_per_value = 0; - float binary_s = 0; - float decimal_s = 0; - double reference_value = 0; - - long binary_scale_factor; - long decimal_scale_factor; - long typeOfOriginalFieldValues; - long groupSplittingMethodUsed; - long missingValueManagementUsed; - long primaryMissingValueSubstitute; - long secondaryMissingValueSubstitute; - long numberOfGroupsOfDataValues; - long referenceForGroupWidths; - long numberOfBitsUsedForTheGroupWidths; - long referenceForGroupLengths; - long lengthIncrementForTheGroupLengths; - long trueLengthOfLastGroup; - long numberOfBitsUsedForTheScaledGroupLengths; - long orderOfSpatialDifferencing; - long numberOfOctetsExtraDescriptors; - double missingValue = 0; - - err = grib_value_count(a, &n_vals); - if (err) - return err; - - if (*len < (size_t)n_vals) - return GRIB_ARRAY_TOO_SMALL; - - if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) - return err; - - /* Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) - return err; - - self->dirty = 0; - - sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); - if (!sec_val) - return GRIB_OUT_OF_MEMORY; - memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ - - buf_ref = buf + a->offset; - - ref_p = (numberOfGroupsOfDataValues * bits_per_value); - - if (orderOfSpatialDifferencing) - ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); - - buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); - - width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); - buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); - - length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); - buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); - - length_p = 0; - ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; - width_p = 0; - vals_p = 0; - vcount = 0; - - for (i = 0; i < numberOfGroupsOfDataValues; i++) { - group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); - nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); - nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); - - nvals_per_group *= lengthIncrementForTheGroupLengths; - nvals_per_group += referenceForGroupLengths; - nbits_per_group_val += referenceForGroupWidths; - - if (i == numberOfGroupsOfDataValues - 1) - nvals_per_group = trueLengthOfLastGroup; - Assert(n_vals >= vcount + nvals_per_group); - - /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, - &sec_val[vcount]); */ - if (missingValueManagementUsed == 0) { - /* No explicit missing values included within data values */ - for (j = 0; j < nvals_per_group; j++) { - DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); - sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ - } - } - else if (missingValueManagementUsed == 1) { - /* Primary missing values included within data values */ - long maxn = 0; /* (1 << bits_per_value) - 1; */ - for (j = 0; j < nvals_per_group; j++) { - if (nbits_per_group_val == 0) { - maxn = (1 << bits_per_value) - 1; - if (group_ref_val == maxn) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount + j] = group_ref_val + temp; - } - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - if (temp == maxn) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - sec_val[vcount + j] = group_ref_val + temp; - } - } - } - } - else if (missingValueManagementUsed == 2) { - /* Primary and secondary missing values included within data values */ - long maxn = (1 << bits_per_value) - 1; - long maxn2 = 0; /* maxn - 1; */ - for (j = 0; j < nvals_per_group; j++) { - if (nbits_per_group_val == 0) { - maxn2 = maxn - 1; - if (group_ref_val == maxn || group_ref_val == maxn2) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount + j] = group_ref_val + temp; - } - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - maxn2 = maxn - 1; - if (temp == maxn || temp == maxn2) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - sec_val[vcount + j] = group_ref_val + temp; - } - } - } - } - - vcount += nvals_per_group; - } - - if (orderOfSpatialDifferencing) { - long bias = 0; - unsigned long extras[2] = {0,}; - ref_p = 0; - - /* For Complex packing, order == 0 */ - /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ - if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); - return GRIB_INTERNAL_ERROR; - } - - for (i = 0; i < orderOfSpatialDifferencing; i++) { - extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); - } - - bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); - - post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); - /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ - } - - binary_s = grib_power(binary_scale_factor, 2); - decimal_s = grib_power(-decimal_scale_factor, 10); - - for (i = 0; i < n_vals; i++) { - if (sec_val[i] == LONG_MAX) { - val[i] = missingValue; - } - else { - val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; - } - } - - grib_context_free(a->context, sec_val); - return err; -} static int pack_double(grib_accessor* a, const double* val, size_t* len) { @@ -1025,12 +498,12 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) return err; - /*if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err;*/ - /* Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: - * 0 Row by row splitting - * 1 General group splitting - * We only support General group splitting - */ + /*if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err;/* + /* Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: + * 0 Row by row splitting + * 1 General group splitting + * We only support General group splitting + */ groupSplittingMethodUsed = 1; if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) @@ -1056,7 +529,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) numberOfBitsUsedForTheGroupWidths = 4; numberOfBitsUsedForTheScaledGroupLengths = 10; - /* calculation of integer array */ + /* calculation of integer array */ sec_val = (unsigned long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); if (!sec_val) return GRIB_OUT_OF_MEMORY; diff --git a/src/grib_accessor_class_data_g22order_packing.h b/src/grib_accessor_class_data_g22order_packing.h new file mode 100644 index 000000000..70a6f612b --- /dev/null +++ b/src/grib_accessor_class_data_g22order_packing.h @@ -0,0 +1,293 @@ +#pragma once + +#include "grib_api_internal.h" + +typedef struct grib_accessor_data_g22order_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_g22order_packing */ + const char* numberOfValues; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* typeOfOriginalFieldValues; + const char* groupSplittingMethodUsed; + const char* missingValueManagementUsed; + const char* primaryMissingValueSubstitute; + const char* secondaryMissingValueSubstitute; + const char* numberOfGroupsOfDataValues; + const char* referenceForGroupWidths; + const char* numberOfBitsUsedForTheGroupWidths; + const char* referenceForGroupLengths; + const char* lengthIncrementForTheGroupLengths; + const char* trueLengthOfLastGroup; + const char* numberOfBitsUsedForTheScaledGroupLengths; + const char* orderOfSpatialDifferencing; + const char* numberOfOctetsExtraDescriptors; +} grib_accessor_data_g22order_packing; + +int post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]); + +template +class GribAccessorDataG22orderPacking { +public: + static int unpack(grib_accessor* a, T* val, size_t* len); +}; + +template +int GribAccessorDataG22orderPacking::unpack(grib_accessor* a, T* val, size_t* len) +{ + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + + size_t i = 0; + size_t j = 0; + long n_vals = 0; + long vcount = 0; + int err = GRIB_SUCCESS; + + long* sec_val = NULL; + grib_handle* gh = grib_handle_of_accessor(a); + + unsigned char* buf = (unsigned char*)gh->buffer->data; + unsigned char* buf_ref = NULL; + unsigned char* buf_width = NULL; + unsigned char* buf_length = NULL; + unsigned char* buf_vals = NULL; + + long length_p = 0; + long ref_p = 0; + long width_p = 0; + long vals_p = 0; + + long nvals_per_group = 0; + long nbits_per_group_val = 0; + long group_ref_val = 0; + + long bits_per_value = 0; + T binary_s = 0; + T decimal_s = 0; + double reference_value = 0; + + long binary_scale_factor; + long decimal_scale_factor; + long typeOfOriginalFieldValues; + long groupSplittingMethodUsed; + long missingValueManagementUsed; + long primaryMissingValueSubstitute; + long secondaryMissingValueSubstitute; + long numberOfGroupsOfDataValues; + long referenceForGroupWidths; + long numberOfBitsUsedForTheGroupWidths; + long referenceForGroupLengths; + long lengthIncrementForTheGroupLengths; + long trueLengthOfLastGroup; + long numberOfBitsUsedForTheScaledGroupLengths; + long orderOfSpatialDifferencing; + long numberOfOctetsExtraDescriptors; + double missingValue = 0; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if (*len < (size_t)n_vals) + return GRIB_ARRAY_TOO_SMALL; + + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) + return err; + + /* Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) + return err; + + self->dirty = 0; + + sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); + if (!sec_val) + return GRIB_OUT_OF_MEMORY; + memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ + + buf_ref = buf + a->offset; + + ref_p = (numberOfGroupsOfDataValues * bits_per_value); + + if (orderOfSpatialDifferencing) + ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); + + buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); + + width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); + buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); + + length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); + buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); + + length_p = 0; + ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; + width_p = 0; + vals_p = 0; + vcount = 0; + + for (i = 0; i < numberOfGroupsOfDataValues; i++) { + group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); + nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); + nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); + + nvals_per_group *= lengthIncrementForTheGroupLengths; + nvals_per_group += referenceForGroupLengths; + nbits_per_group_val += referenceForGroupWidths; + + if (i == numberOfGroupsOfDataValues - 1) + nvals_per_group = trueLengthOfLastGroup; + Assert(n_vals >= vcount + nvals_per_group); + + /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, + &sec_val[vcount]); */ + if (missingValueManagementUsed == 0) { + /* No explicit missing values included within data values */ + for (j = 0; j < nvals_per_group; j++) { + DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); + sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ + } + } + else if (missingValueManagementUsed == 1) { + /* Primary missing values included within data values */ + long maxn = 0; /* (1 << bits_per_value) - 1; */ + for (j = 0; j < nvals_per_group; j++) { + if (nbits_per_group_val == 0) { + maxn = (1 << bits_per_value) - 1; + if (group_ref_val == maxn) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; + } + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + if (temp == maxn) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; + } + } + } + } + else if (missingValueManagementUsed == 2) { + /* Primary and secondary missing values included within data values */ + long maxn = (1 << bits_per_value) - 1; + long maxn2 = 0; /* maxn - 1; */ + for (j = 0; j < nvals_per_group; j++) { + if (nbits_per_group_val == 0) { + maxn2 = maxn - 1; + if (group_ref_val == maxn || group_ref_val == maxn2) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; + } + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + maxn2 = maxn - 1; + if (temp == maxn || temp == maxn2) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; + } + } + } + } + + vcount += nvals_per_group; + } + + if (orderOfSpatialDifferencing) { + long bias = 0; + unsigned long extras[2] = {0,}; + ref_p = 0; + + /* For Complex packing, order == 0 */ + /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ + if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); + return GRIB_INTERNAL_ERROR; + } + + for (i = 0; i < orderOfSpatialDifferencing; i++) { + extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); + } + + bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); + + post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); + /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ + } + + binary_s = grib_power(binary_scale_factor, 2); + decimal_s = grib_power(-decimal_scale_factor, 10); + + for (i = 0; i < n_vals; i++) { + if (sec_val[i] == LONG_MAX) { + val[i] = missingValue; + } + else { + val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; + } + } + + grib_context_free(a->context, sec_val); + return err; +} + From 9371a3208eeb59c2728193305580f8a63776f3c6 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 1 Mar 2023 13:27:41 +0000 Subject: [PATCH 119/212] ECC-1467: typename check in templates --- src/grib_accessor_class_data_ccsds_packing.h | 3 +++ src/grib_accessor_class_data_complex_packing.h | 1 + src/grib_accessor_class_data_g22order_packing.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/grib_accessor_class_data_ccsds_packing.h b/src/grib_accessor_class_data_ccsds_packing.h index 75b13ac29..4edc152d3 100644 --- a/src/grib_accessor_class_data_ccsds_packing.h +++ b/src/grib_accessor_class_data_ccsds_packing.h @@ -1,5 +1,7 @@ #pragma once + #include "grib_api_internal_cpp.h" +#include #if defined(HAVE_LIBAEC) || defined(HAVE_AEC) #include @@ -42,6 +44,7 @@ class GribAccessorDataCcsdsPacking { template int GribAccessorDataCcsdsPacking::unpack(grib_accessor* a, T* val, size_t* len) { + static_assert(std::is_floating_point::value, "Requires floating point numbers"); grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; grib_handle* hand = grib_handle_of_accessor(a); diff --git a/src/grib_accessor_class_data_complex_packing.h b/src/grib_accessor_class_data_complex_packing.h index be7b7287f..c490f8218 100644 --- a/src/grib_accessor_class_data_complex_packing.h +++ b/src/grib_accessor_class_data_complex_packing.h @@ -51,6 +51,7 @@ class GribAccessorClassDataComplexPacking { template int GribAccessorClassDataComplexPacking::unpack(grib_accessor* a, T* val, size_t* len) { + static_assert(std::is_floating_point::value, "Requires floating point numbers"); grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; grib_handle* gh = grib_handle_of_accessor(a); diff --git a/src/grib_accessor_class_data_g22order_packing.h b/src/grib_accessor_class_data_g22order_packing.h index 70a6f612b..70ac1a63a 100644 --- a/src/grib_accessor_class_data_g22order_packing.h +++ b/src/grib_accessor_class_data_g22order_packing.h @@ -1,6 +1,7 @@ #pragma once #include "grib_api_internal.h" +#include typedef struct grib_accessor_data_g22order_packing { @@ -45,6 +46,7 @@ class GribAccessorDataG22orderPacking { template int GribAccessorDataG22orderPacking::unpack(grib_accessor* a, T* val, size_t* len) { + static_assert(std::is_floating_point::value, "Requires floating points numbers"); grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; size_t i = 0; From e65b2edad45d43b85000c6e9c13abf20fc451bbc Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 1 Mar 2023 14:50:42 +0000 Subject: [PATCH 120/212] Rerun make_class.pl --- src/action_class_concept.cc | 4 +- ..._accessor_class_data_run_length_packing.cc | 156 +++++++++--------- src/grib_iterator_class_latlon.cc | 14 +- 3 files changed, 89 insertions(+), 85 deletions(-) diff --git a/src/action_class_concept.cc b/src/action_class_concept.cc index 36fbefde1..8631da30a 100644 --- a/src/action_class_concept.cc +++ b/src/action_class_concept.cc @@ -21,7 +21,7 @@ SUPER = action_class_gen IMPLEMENTS = dump IMPLEMENTS = destroy - MEMBERS = grib_concept_value* concept + MEMBERS = grib_concept_value* concept_value MEMBERS = char* basename MEMBERS = char* masterDir MEMBERS = char* localDir @@ -46,7 +46,7 @@ static void destroy (grib_context*,grib_action*); typedef struct grib_action_concept { - grib_action act; + grib_action act; /* Members defined in gen */ long len; grib_arguments* params; diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/grib_accessor_class_data_run_length_packing.cc index 46e835716..f8aff3adf 100644 --- a/src/grib_accessor_class_data_run_length_packing.cc +++ b/src/grib_accessor_class_data_run_length_packing.cc @@ -49,63 +49,64 @@ typedef struct grib_accessor_data_run_length_packing grib_accessor att; /* Members defined in gen */ /* Members defined in values */ - int carg; + int carg; const char* seclen; const char* offsetdata; const char* offsetsection; int dirty; /* Members defined in data_run_length_packing */ - const char* number_of_values; - const char* bits_per_value; - const char* max_level_value; - const char* number_of_level_values; - const char* decimal_scale_factor; - const char* level_values; + const char* number_of_values; + const char* bits_per_value; + const char* max_level_value; + const char* number_of_level_values; + const char* decimal_scale_factor; + const char* level_values; } grib_accessor_data_run_length_packing; extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_run_length_packing = { - &grib_accessor_class_values, /* super */ - "data_run_length_packing", /* name */ - sizeof(grib_accessor_data_run_length_packing), /* size */ - 0, /* inited */ - &init_class, /* init_class */ - &init, /* init */ - 0, /* post_init */ - 0, /* free mem */ - 0, /* describes himself */ - 0, /* get length of section */ - 0, /* get length of string */ - &value_count, /* get number of values */ - 0, /* get number of bytes */ - 0, /* get offset to bytes */ - 0, /* get native type */ - 0, /* get sub_section */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_pack procedures long */ - 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ - &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_pack procedures string */ - 0, /* grib_unpack procedures string */ - 0, /* grib_pack array procedures string */ - 0, /* grib_unpack array procedures string */ - 0, /* grib_pack procedures bytes */ - 0, /* grib_unpack procedures bytes */ - 0, /* pack_expression */ - 0, /* notify_change */ - 0, /* update_size */ - 0, /* preferred_size */ - 0, /* resize */ - 0, /* nearest_smaller_value */ - 0, /* next accessor */ - 0, /* compare vs. another accessor */ - 0, /* unpack only ith value */ - 0, /* unpack a subarray */ - 0, /* clear */ - 0, /* clone accessor */ + &grib_accessor_class_values, /* super */ + "data_run_length_packing", /* name */ + sizeof(grib_accessor_data_run_length_packing), /* size */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* free mem */ + 0, /* describes himself */ + 0, /* get length of section */ + 0, /* get length of string */ + &value_count, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + 0, /* get native type */ + 0, /* get sub_section */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_pack procedures long */ + 0, /* grib_unpack procedures long */ + 0, /* grib_pack procedures double */ + &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_pack procedures string */ + 0, /* grib_unpack procedures string */ + 0, /* grib_pack array procedures string */ + 0, /* grib_unpack array procedures string */ + 0, /* grib_pack procedures bytes */ + 0, /* grib_unpack procedures bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value */ + 0, /* unpack a given set of elements */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ }; @@ -114,36 +115,37 @@ grib_accessor_class* grib_accessor_class_data_run_length_packing = &_grib_access static void init_class(grib_accessor_class* c) { - c->dump = (*(c->super))->dump; - c->next_offset = (*(c->super))->next_offset; - c->string_length = (*(c->super))->string_length; - c->byte_count = (*(c->super))->byte_count; - c->byte_offset = (*(c->super))->byte_offset; - c->get_native_type = (*(c->super))->get_native_type; - c->sub_section = (*(c->super))->sub_section; - c->pack_missing = (*(c->super))->pack_missing; - c->is_missing = (*(c->super))->is_missing; - c->pack_long = (*(c->super))->pack_long; - c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; - c->pack_string = (*(c->super))->pack_string; - c->unpack_string = (*(c->super))->unpack_string; - c->pack_string_array = (*(c->super))->pack_string_array; - c->unpack_string_array = (*(c->super))->unpack_string_array; - c->pack_bytes = (*(c->super))->pack_bytes; - c->unpack_bytes = (*(c->super))->unpack_bytes; - c->pack_expression = (*(c->super))->pack_expression; - c->notify_change = (*(c->super))->notify_change; - c->update_size = (*(c->super))->update_size; - c->preferred_size = (*(c->super))->preferred_size; - c->resize = (*(c->super))->resize; - c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; - c->next = (*(c->super))->next; - c->compare = (*(c->super))->compare; - c->unpack_double_element = (*(c->super))->unpack_double_element; - c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; - c->clear = (*(c->super))->clear; - c->make_clone = (*(c->super))->make_clone; + c->dump = (*(c->super))->dump; + c->next_offset = (*(c->super))->next_offset; + c->string_length = (*(c->super))->string_length; + c->byte_count = (*(c->super))->byte_count; + c->byte_offset = (*(c->super))->byte_offset; + c->get_native_type = (*(c->super))->get_native_type; + c->sub_section = (*(c->super))->sub_section; + c->pack_missing = (*(c->super))->pack_missing; + c->is_missing = (*(c->super))->is_missing; + c->pack_long = (*(c->super))->pack_long; + c->unpack_long = (*(c->super))->unpack_long; + c->pack_double = (*(c->super))->pack_double; + c->pack_string = (*(c->super))->pack_string; + c->unpack_string = (*(c->super))->unpack_string; + c->pack_string_array = (*(c->super))->pack_string_array; + c->unpack_string_array = (*(c->super))->unpack_string_array; + c->pack_bytes = (*(c->super))->pack_bytes; + c->unpack_bytes = (*(c->super))->unpack_bytes; + c->pack_expression = (*(c->super))->pack_expression; + c->notify_change = (*(c->super))->notify_change; + c->update_size = (*(c->super))->update_size; + c->preferred_size = (*(c->super))->preferred_size; + c->resize = (*(c->super))->resize; + c->nearest_smaller_value = (*(c->super))->nearest_smaller_value; + c->next = (*(c->super))->next; + c->compare = (*(c->super))->compare; + c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; + c->clear = (*(c->super))->clear; + c->make_clone = (*(c->super))->make_clone; } /* END_CLASS_IMP */ diff --git a/src/grib_iterator_class_latlon.cc b/src/grib_iterator_class_latlon.cc index bddaa2898..d0e4d2d54 100644 --- a/src/grib_iterator_class_latlon.cc +++ b/src/grib_iterator_class_latlon.cc @@ -32,9 +32,11 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); -static int init (grib_iterator* i,grib_handle*,grib_arguments*); -static int next (grib_iterator* i, double *lat, double *lon, double *val); +static void init_class (grib_iterator_class*); + +static int init (grib_iterator* i,grib_handle*,grib_arguments*); +static int next (grib_iterator* i, double *lat, double *lon, double *val); + typedef struct grib_iterator_latlon{ grib_iterator it; @@ -77,9 +79,9 @@ grib_iterator_class* grib_iterator_class_latlon = &_grib_iterator_class_latlon; static void init_class(grib_iterator_class* c) { - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ From 36b6e1b84cd643ba5042795d09fab0a1177d437b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 1 Mar 2023 14:50:59 +0000 Subject: [PATCH 121/212] Rerun make_class.pl --- src/grib_iterator_class_gaussian.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/grib_iterator_class_gaussian.cc b/src/grib_iterator_class_gaussian.cc index 11b9d6641..366505b71 100644 --- a/src/grib_iterator_class_gaussian.cc +++ b/src/grib_iterator_class_gaussian.cc @@ -36,8 +36,10 @@ or edit "iterator.class" and rerun ./make_class.pl */ -static void init_class (grib_iterator_class*); -static int init (grib_iterator* i,grib_handle*,grib_arguments*); +static void init_class (grib_iterator_class*); + +static int init (grib_iterator* i,grib_handle*,grib_arguments*); + typedef struct grib_iterator_gaussian{ grib_iterator it; @@ -80,10 +82,10 @@ grib_iterator_class* grib_iterator_class_gaussian = &_grib_iterator_class_gaussi static void init_class(grib_iterator_class* c) { - c->next = (*(c->super))->next; - c->previous = (*(c->super))->previous; - c->reset = (*(c->super))->reset; - c->has_next = (*(c->super))->has_next; + c->next = (*(c->super))->next; + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; } /* END_CLASS_IMP */ From d3617924e126cea0cda916c99e3369a7b35e2fff Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 2 Mar 2023 18:15:54 +0000 Subject: [PATCH 122/212] Better error message for grid_run_length --- src/grib_accessor_class_data_run_length_packing.cc | 11 +++++++++-- tests/create_test.sh | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/grib_accessor_class_data_run_length_packing.cc index f8aff3adf..55b46f0b9 100644 --- a/src/grib_accessor_class_data_run_length_packing.cc +++ b/src/grib_accessor_class_data_run_length_packing.cc @@ -18,6 +18,7 @@ SUPER = grib_accessor_class_values IMPLEMENTS = init IMPLEMENTS = unpack_double + IMPLEMENTS = pack_double IMPLEMENTS = value_count MEMBERS=const char* number_of_values MEMBERS=const char* bits_per_value @@ -39,6 +40,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ +static int pack_double(grib_accessor*, const double* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); @@ -86,7 +88,7 @@ static grib_accessor_class _grib_accessor_class_data_run_length_packing = { 0, /* grib_pack procedures long */ 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ - 0, /* grib_pack procedures double */ + &pack_double, /* grib_pack procedures double */ &unpack_double, /* grib_unpack procedures double */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ @@ -126,7 +128,6 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; - c->pack_double = (*(c->super))->pack_double; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -267,3 +268,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) } return err; } + +static int pack_double(grib_accessor* a, const double* val, size_t* len) +{ + grib_context_log(a->context, GRIB_LOG_ERROR, "Changing the packing type to 'grid_run_length' is not implemented."); + return GRIB_NOT_IMPLEMENTED; +} diff --git a/tests/create_test.sh b/tests/create_test.sh index 6dd1b143b..47e04c547 100755 --- a/tests/create_test.sh +++ b/tests/create_test.sh @@ -34,10 +34,14 @@ cat <&2 From ef32525862a27ab0ada64860a561622017e117fb Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Mar 2023 12:42:01 +0000 Subject: [PATCH 123/212] Improved error message --- src/grib_accessor_class_concept.cc | 37 ++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index 9fb598f3b..62ed43500 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -342,6 +342,31 @@ static int cmpstringp(const void* p1, const void* p2) return strcmp(*(char* const*)p1, *(char* const*)p2); } +static bool blacklisted(grib_handle* h, long edition, const char* concept_name, const char* concept_value) +{ + if ( strcmp(concept_name, "packingType")==0 ) { + char input_packing_type[100]; + size_t len = sizeof(input_packing_type); + if (strstr(concept_value, "SPD")) { + return true; + } + if (edition == 2 && strstr(concept_value, "grid_run_length")) { + return true; + } + if (edition == 1 && (strstr(concept_value, "ccsds") || strstr(concept_value, "jpeg"))) { + return true; + } + grib_get_string(h, "packingType", input_packing_type, &len); + if (strstr(input_packing_type,"grid_") && !strstr(concept_value,"grid_")) { + return true; + } + if (strstr(input_packing_type,"spectral_") && !strstr(concept_value,"spectral_")) { + return true; + } + } + return false; +} + static int grib_concept_apply(grib_accessor* a, const char* name) { int err = 0; @@ -397,16 +422,20 @@ static int grib_concept_apply(grib_accessor* a, const char* name) /* Only print out all concepts if fewer than MAX_NUM_CONCEPT_VALUES. * Printing out all values for concepts like paramId would be silly! */ if (concept_count < MAX_NUM_CONCEPT_VALUES) { - fprintf(stderr, "Here are the possible values for concept %s:\n", act->name); + fprintf(stderr, "Here are some possible values for concept %s:\n", act->name); qsort(&all_concept_vals, concept_count, sizeof(char*), cmpstringp); for (i = 0; i < concept_count; ++i) { if (all_concept_vals[i]) { - int print_it = 1; + bool print_it = true; if (i > 0 && all_concept_vals[i - 1] && strcmp(all_concept_vals[i], all_concept_vals[i - 1]) == 0) { - print_it = 0; /* skip duplicate entries */ + print_it = false; /* skip duplicate entries */ } - if (print_it) + if (blacklisted(h, editionNumber, act->name, all_concept_vals[i])) { + print_it = false; + } + if (print_it) { fprintf(stderr, "\t%s\n", all_concept_vals[i]); + } } } } From 46033cdd2b8e60659145a605451d60d3b79724a2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Mar 2023 13:18:01 +0000 Subject: [PATCH 124/212] Remove unused function --- src/eccodes_prototypes.h | 1 - src/grib_header_compute.cc | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 8ce8e2bcb..d2c72cd68 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1070,7 +1070,6 @@ void grib_multi_support_reset(grib_context* c); /* grib_header_compute.cc*/ void print_math(grib_math* m); -grib_math* grib_math_clone(grib_context* c, grib_math* m); void grib_math_delete(grib_context* c, grib_math* m); grib_math* grib_math_new(grib_context* c, const char* formula, int* err); diff --git a/src/grib_header_compute.cc b/src/grib_header_compute.cc index d8f9fb29f..da68f004e 100644 --- a/src/grib_header_compute.cc +++ b/src/grib_header_compute.cc @@ -415,19 +415,19 @@ static grib_math* reador(grib_context* c, char** form, int* err) return p; } -grib_math* grib_math_clone(grib_context* c, grib_math* m) -{ - grib_math* n = NULL; - if (m) { - n = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); - n->arity = m->arity; - n->name = strdup(m->name); - Assert(n->name); - n->left = grib_math_clone(c, m->left); - n->right = grib_math_clone(c, m->right); - } - return n; -} +// static grib_math* grib_math_clone(grib_context* c, grib_math* m) +// { +// grib_math* n = NULL; +// if (m) { +// n = (grib_math*)grib_context_malloc(c, sizeof(grib_math)); +// n->arity = m->arity; +// n->name = strdup(m->name); +// Assert(n->name); +// n->left = grib_math_clone(c, m->left); +// n->right = grib_math_clone(c, m->right); +// } +// return n; +// } void grib_math_delete(grib_context* c, grib_math* m) { From 5c4867198e8191ceedc7633fbdc020b9c0fd8782 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Mar 2023 13:18:42 +0000 Subject: [PATCH 125/212] Mitigating strncpy truncation --- src/grib_accessor_class_codeflag.cc | 5 ++++- src/grib_context.cc | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/grib_accessor_class_codeflag.cc b/src/grib_accessor_class_codeflag.cc index f3ced0315..f0bf6c0c7 100644 --- a/src/grib_accessor_class_codeflag.cc +++ b/src/grib_accessor_class_codeflag.cc @@ -168,7 +168,10 @@ static int grib_get_codeflag(grib_accessor* a, long code, char* codename) int err = 0; err = grib_recompose_name(grib_handle_of_accessor(a), NULL, self->tablename, fname, 1); - if (err) strncpy(fname, self->tablename, 1023); + if (err) { + strncpy(fname, self->tablename, sizeof(fname)-1); + fname[sizeof(fname)-1] = '\0'; + } if ((filename = grib_context_full_defs_path(a->context, fname)) == NULL) { grib_context_log(a->context, GRIB_LOG_WARNING, "Cannot open flag table %s", filename); diff --git a/src/grib_context.cc b/src/grib_context.cc index c2c49aa92..e046428b4 100644 --- a/src/grib_context.cc +++ b/src/grib_context.cc @@ -643,6 +643,7 @@ static int init_definition_files_dir(grib_context* c) /* Note: strtok_r modifies its first argument so we copy */ strncpy(path, c->grib_definition_files_path, ECC_PATH_MAXLEN-1); + path[ ECC_PATH_MAXLEN - 1 ] = '\0'; GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex_c); From 9492b5f389cdf0d92c2da7532903685e36b0031f Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Fri, 3 Mar 2023 15:25:12 +0000 Subject: [PATCH 126/212] Small changes for true-imagery template --- definitions/grib2/tables/30/4.0.table | 7 ++++- tests/CMakeLists.txt | 1 + tests/grib_true-imagery.sh | 45 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100755 tests/grib_true-imagery.sh diff --git a/definitions/grib2/tables/30/4.0.table b/definitions/grib2/tables/30/4.0.table index 3b35b9c5c..9929cea35 100644 --- a/definitions/grib2/tables/30/4.0.table +++ b/definitions/grib2/tables/30/4.0.table @@ -80,7 +80,12 @@ 96 96 Average, accumulation, extreme values or other statistically processed values of an individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time 97 97 Average, accumulation, extreme values or other statistically processed values of post-processing analysis or forecast at a horizontal level or in a horizontal layer at a specified local time 98 98 Average, accumulation, extreme values or other statistically processed values of a post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time -# 99-253 Reserved +# 99-107 Reserved +108 108 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical properties +109 109 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for generic optical properties +110 110 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties +111 111 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties +# 112-253 Reserved 254 254 CCITT IA5 character string # 255-999 Reserved 1000 1000 Cross-section of analysis and forecast at a point in time diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 344004292..1033446e5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -94,6 +94,7 @@ if( HAVE_BUILD_TOOLS ) grib_uerra grib_s2s grib_fire + grib_true-imagery grib_element grib_suppressed grib_2nd_order_numValues diff --git a/tests/grib_true-imagery.sh b/tests/grib_true-imagery.sh new file mode 100755 index 000000000..834fa415e --- /dev/null +++ b/tests/grib_true-imagery.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh +set -u +REDIRECT=/dev/null +label="grib_true-imagery_test" # Change prod to bufr or grib etc +temp=temp.$label +tempd=temp_dump.$label +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +latest=30 # TODO + +## PDTN 108 - Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical products +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=108 $sample_grib2 $temp +${tools_dir}/grib_dump -O $temp > $tempd +grep -q 'Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical properties' $tempd +grib_check_key_equals $temp typeOfWavelengthInterval,scaledValueOfFirstWavelength,scaledValueOfSecondWavelength "0 0 MISSING" + +## PDTN 109 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for generic optical products +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=109 $sample_grib2 $temp +${tools_dir}/grib_dump -O $temp > $tempd +grep -q 'Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for generic optical properties' $tempd +grib_check_key_equals $temp typeOfWavelengthInterval,scaledValueOfFirstWavelength,scaledValueOfSecondWavelength "0 0 MISSING" + +## PDTN 110 - Average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical products +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=110 $sample_grib2 $temp +${tools_dir}/grib_dump -O $temp > $tempd +grep -q 'Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties' $tempd +grib_check_key_equals $temp typeOfWavelengthInterval,scaledValueOfFirstWavelength,scaledValueOfSecondWavelength "0 0 MISSING" + +## PDTN 111 - Average, accumulation, extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical products +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=111 $sample_grib2 $temp +${tools_dir}/grib_dump -O $temp > $tempd +grep -q 'Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties' $tempd +grib_check_key_equals $temp typeOfWavelengthInterval,scaledValueOfFirstWavelength,scaledValueOfSecondWavelength "0 0 MISSING" + +rm -f $temp $tempd From d1d094cf8a995c8232a0bf892c6a723ffa7c5c4c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 3 Mar 2023 17:33:44 +0000 Subject: [PATCH 127/212] Compiler warning: macro redefined --- src/grib_context.cc | 1 - tools/grib_tools.cc | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/grib_context.cc b/src/grib_context.cc index e046428b4..3bfc44982 100644 --- a/src/grib_context.cc +++ b/src/grib_context.cc @@ -19,7 +19,6 @@ #endif #ifdef ENABLE_FLOATING_POINT_EXCEPTIONS - #define _GNU_SOURCE #include int feenableexcept(int excepts); #endif diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index af8d71f0a..0f2edd7e9 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -21,9 +21,8 @@ #endif #ifdef ENABLE_FLOATING_POINT_EXCEPTIONS -#define _GNU_SOURCE -#include -int feenableexcept(int excepts); + #include + int feenableexcept(int excepts); #endif GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) From f48f536a1db1347560d89a1a5422dcc972782926 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Mar 2023 12:44:37 +0000 Subject: [PATCH 128/212] Compiler warnings: comparison of integers of different signs [-Wsign-compare] --- src/grib_accessor_class_ascii.cc | 18 ++++++++++-------- ...or_class_change_alternative_row_scanning.cc | 4 ++-- src/grib_accessor_class_data_ccsds_packing.cc | 11 ++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/grib_accessor_class_ascii.cc b/src/grib_accessor_class_ascii.cc index 985719457..e571d9d03 100644 --- a/src/grib_accessor_class_ascii.cc +++ b/src/grib_accessor_class_ascii.cc @@ -167,17 +167,18 @@ static int get_native_type(grib_accessor* a) static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int i = 0; + size_t i = 0; grib_handle* hand = grib_handle_of_accessor(a); + const size_t alen = a->length; - if (len[0] < (a->length + 1)) { - grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s it contains %ld values", + if (len[0] < (alen + 1)) { + grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%zu) for %s, it contains %ld values", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } - for (i = 0; i < a->length; i++) + for (i = 0; i < alen; i++) val[i] = hand->buffer->data[a->offset + i]; val[i] = 0; len[0] = i; @@ -186,16 +187,17 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) static int pack_string(grib_accessor* a, const char* val, size_t* len) { - int i = 0; + size_t i = 0; grib_handle* hand = grib_handle_of_accessor(a); - if (len[0] > (a->length) + 1) { + const size_t alen = a->length; + if (len[0] > (alen + 1)) { grib_context_log(a->context, GRIB_LOG_ERROR, - "pack_string: Wrong size (%lu) for %s it contains %ld values", len[0], a->name, a->length + 1); + "pack_string: Wrong size (%zu) for %s, it contains %ld values", len[0], a->name, a->length + 1); len[0] = 0; return GRIB_BUFFER_TOO_SMALL; } - for (i = 0; i < a->length; i++) { + for (i = 0; i < alen; i++) { if (i < len[0]) hand->buffer->data[a->offset + i] = val[i]; else diff --git a/src/grib_accessor_class_change_alternative_row_scanning.cc b/src/grib_accessor_class_change_alternative_row_scanning.cc index a780ec82b..26abceda9 100644 --- a/src/grib_accessor_class_change_alternative_row_scanning.cc +++ b/src/grib_accessor_class_change_alternative_row_scanning.cc @@ -187,8 +187,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if ((err = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) return err; - if (size > Ni * Nj) { - grib_context_log(c, GRIB_LOG_ERROR, "change_alternative_row_scanning: wrong values size!=Ni*Nj (%ld!=%ld*%ld)", size, Ni, Nj); + if ( size > (size_t)(Ni * Nj) ) { + grib_context_log(c, GRIB_LOG_ERROR, "change_alternative_row_scanning: wrong values size!=Ni*Nj (%zu!=%ld*%ld)", size, Ni, Nj); return GRIB_WRONG_ARRAY_SIZE; } diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 28074c5d2..40877ade2 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -219,8 +219,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; grib_handle* hand = grib_handle_of_accessor(a); - int err = GRIB_SUCCESS, i = 0; - size_t buflen = 0; + int err = GRIB_SUCCESS; + size_t buflen = 0, i = 0; struct aec_stream strm; double bscale = 0; double dscale = 0; @@ -334,8 +334,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; grib_handle* hand = grib_handle_of_accessor(a); - int err = GRIB_SUCCESS, i = 0, is_constant_field = 0; - size_t buflen = 0; + int err = GRIB_SUCCESS; + size_t buflen = 0, i = 0; + bool is_constant_field = false; unsigned char* buf = NULL; unsigned char* encoded = NULL; @@ -395,7 +396,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } if (min == max) { - is_constant_field = 1; + is_constant_field = true; } else { if (bits_per_value == 0) { /* ECC-1202: A non-constant field with bitsPerValue==0! */ From 0d0f0a68994b4c2b0ef52af4807c209032242ca2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Mar 2023 12:45:31 +0000 Subject: [PATCH 129/212] Migration to C++: Use builtin bool type --- tools/grib_to_netcdf.cc | 261 ++++++++++++++++++++-------------------- 1 file changed, 129 insertions(+), 132 deletions(-) diff --git a/tools/grib_to_netcdf.cc b/tools/grib_to_netcdf.cc index ea0744e5e..ec7415688 100644 --- a/tools/grib_to_netcdf.cc +++ b/tools/grib_to_netcdf.cc @@ -48,13 +48,9 @@ static double global_missing_value = 9.9692099683868690e+36; /* See GRIB-953 */ #define NUMBER(x) (sizeof(x) / sizeof(x[0])) -typedef int boolean; typedef int err; typedef off_t file_offset; -static int FALSE = 0; -static int TRUE = 1; - static int files = 0; struct value @@ -85,60 +81,60 @@ struct parameter typedef struct parameter parameter; static const char* get_value(const request*, const char* name, int n); -static boolean parsedate(const char* name, long* julian, long* second, boolean* isjul); +static bool parsedate(const char* name, long* julian, long* second, bool* isjul); -static boolean eq_string(const char* l, const char* r) +static bool eq_string(const char* l, const char* r) { if (l && r) return strcmp(l, r) == 0; - return FALSE; + return false; } -static boolean eq_integer(const char* l, const char* r) +static bool eq_integer(const char* l, const char* r) { if (l && r) return atol(l) == atol(r); - return FALSE; + return false; } -static boolean eq_null(const char* l, const char* r) +static bool eq_null(const char* l, const char* r) { - return TRUE; + return true; } -static boolean eq_coord(const char* l, const char* r) +static bool eq_coord(const char* l, const char* r) { if (l && r) return strcmp(l, r) == 0; - return FALSE; + return false; } -static boolean eq_range(const char* l, const char* r) +static bool eq_range(const char* l, const char* r) { if (l && r) return strcmp(l, r) == 0; - return FALSE; + return false; } -static boolean eq_date(const char* l, const char* r) +static bool eq_date(const char* l, const char* r) { if (l && r) return strcmp(l, r) == 0; - return FALSE; + return false; } -static boolean eq_param(const char* l, const char* r) +static bool eq_param(const char* l, const char* r) { if (l && r) return strcmp(l, r) == 0; - return FALSE; + return false; } -static boolean eq_time(const char* l, const char* r) +static bool eq_time(const char* l, const char* r) { if (l && r) return strcmp(l, r) == 0; - return FALSE; + return false; } static value* new_value(const char* name) @@ -175,11 +171,11 @@ static void ecc_reqmerge(parameter* pa, const parameter* pb, request* a) value* va = pa->values; value* last = 0; const char* nb = vb->name; - boolean add = TRUE; + bool add = true; while (va) { if (strcmp(va->name, nb) == 0) { - add = FALSE; + add = false; break; } @@ -201,14 +197,14 @@ static void ecc_reqmerge(parameter* pa, const parameter* pb, request* a) } /* Fast version if a && b same */ -static boolean ecc_reqmerge1(request* a, const request* b) +static bool ecc_reqmerge1(request* a, const request* b) { parameter* pa = a->params; const parameter* pb = b->params; while (pa && pb) { if (strcmp(pa->name, pb->name) != 0) - return FALSE; + return false; ecc_reqmerge(pa, pb, a); @@ -248,13 +244,13 @@ static const char* parse1(const char* p, int* x, int* n) return p; } -static boolean is_number(const char* name) +static bool is_number(const char* name) { const char* p = name; int x, n; if (p == 0 || *p == 0) - return FALSE; + return false; if (*p == '-') p++; @@ -263,7 +259,7 @@ static boolean is_number(const char* name) p = parse1(p, &x, &n); if (n == 0 && *p != '.') - return FALSE; + return false; if (*p == '.') { p++; @@ -278,10 +274,10 @@ static boolean is_number(const char* name) p++; p = parse1(p, &x, &n); if (n == 0) - return FALSE; + return false; } - return *p == 0 ? TRUE : FALSE; + return *p == 0 ? true : false; } static parameter* new_parameter(char* name, value* v) { @@ -292,7 +288,7 @@ static parameter* new_parameter(char* name, value* v) return p; } -static void put_value(request* r, const char* parname, const char* valname, boolean append, boolean unique, boolean ascending) +static void put_value(request* r, const char* parname, const char* valname, bool append, bool unique, bool ascending) { parameter* p; value* v; @@ -393,7 +389,7 @@ static void add_value(request* r, const char* parname, const char* fmt, ...) vsnprintf(buffer, sizeof(buffer), fmt, list); va_end(list); - put_value(r, parname, buffer, TRUE, FALSE, FALSE); + put_value(r, parname, buffer, true, false, false); } static void ecc_reqmerge2(request* a, const request* b) @@ -406,7 +402,7 @@ static void ecc_reqmerge2(request* a, const request* b) if (pa == NULL) { value* v = pb->values; while (v) { - put_value(a, pb->name, v->name, TRUE, TRUE, FALSE); + put_value(a, pb->name, v->name, true, true, false); v = v->next; } } @@ -540,7 +536,7 @@ static void set_value(request* r, const char* parname, const char* fmt, ...) vsnprintf(buffer, sizeof(buffer), fmt, list); va_end(list); - put_value(r, parname, buffer, FALSE, FALSE, FALSE); + put_value(r, parname, buffer, false, false, false); } static err handle_to_request(request* r, grib_handle* g) @@ -624,7 +620,7 @@ static err handle_to_request(request* r, grib_handle* g) /*===============================================================================*/ /*===============================================================================*/ -typedef boolean (*namecmp)(const char*, const char*); +typedef bool (*namecmp)(const char*, const char*); typedef struct hypercube { @@ -682,8 +678,8 @@ typedef struct field /* missing fields/values */ - /*boolean is_missing;*/ /* field is missing */ - boolean has_bitmap; /* field has missing values (= bitmap) */ + /*bool is_missing;*/ /* field is missing */ + bool has_bitmap; /* field has missing values (= bitmap) */ field_request* r; @@ -719,7 +715,7 @@ static const char* get_axis(const hypercube* h, int pos); static const char* get_axis(const hypercube* h, int pos); static int cube_order(const hypercube* h, const request* r); static void free_hypercube(hypercube* h); -static int ecc_cube_position(const hypercube* h, const request* r, boolean remove_holes); +static int ecc_cube_position(const hypercube* h, const request* r, bool remove_holes); static value* clone_one_value(const value* p) { @@ -1143,14 +1139,14 @@ static request* fieldset_to_request(fieldset* fs) /* hypercube from mars client */ /*===============================================================================*/ -static boolean eq_string(const char*, const char*); -static boolean eq_integer(const char*, const char*); -static boolean eq_range(const char*, const char*); -static boolean eq_param(const char*, const char*); -static boolean eq_coord(const char*, const char*); -static boolean eq_date(const char*, const char*); -static boolean eq_time(const char*, const char*); -static boolean eq_null(const char*, const char*); +static bool eq_string(const char*, const char*); +static bool eq_integer(const char*, const char*); +static bool eq_range(const char*, const char*); +static bool eq_param(const char*, const char*); +static bool eq_coord(const char*, const char*); +static bool eq_date(const char*, const char*); +static bool eq_time(const char*, const char*); +static bool eq_null(const char*, const char*); static axis_t global_axis[] = { @@ -1319,7 +1315,7 @@ static axis_t global_axis[] = { static int axisindex(const char* name) { - int i = 0; + size_t i = 0; for (i = 0; i < NUMBER(global_axis); i++) { if (strcmp(name, global_axis[i].name) == 0) return i; @@ -1330,12 +1326,12 @@ static int axisindex(const char* name) static namecmp comparator(const char* name) { static char* dontcompare = NULL; - static boolean first = 1; + static bool first = 1; int i = 0; if (first) { dontcompare = getenv("MARS_DONT_CHECK"); - first = FALSE; + first = false; } if (dontcompare != NULL) { @@ -1460,11 +1456,11 @@ static void valcpy(request* a, request* b, char* aname, char* bname) { parameter* p; if (a && b && (p = find_parameter(b, bname))) { - boolean z = FALSE; + bool z = false; value* v = p->values; while (v) { - put_value(a, aname, v->name, z, FALSE, FALSE); - z = TRUE; + put_value(a, aname, v->name, z, false, false); + z = true; v = v->next; } } @@ -1521,7 +1517,8 @@ static int count_dimensions(const hypercube* h, const char* axis) static int count_hypercube(const request* r) { - int i = 0, count = 1; + int count = 1; + size_t i = 0; for (i = 0; i < NUMBER(global_axis); ++i) { int c = count_values(r, global_axis[i].name); count *= c ? c : 1; @@ -1532,12 +1529,12 @@ static int count_hypercube(const request* r) static int cube_order(const hypercube* h, const request* r) { - return ecc_cube_position(h, r, TRUE); + return ecc_cube_position(h, r, true); } static int cube_position(const hypercube* h, const request* r) { - return ecc_cube_position(h, r, FALSE); + return ecc_cube_position(h, r, false); } static void reserve_index_cache(hypercube* h, int size) @@ -1553,7 +1550,7 @@ static void reserve_index_cache(hypercube* h, int size) h->index_cache_size = size; } -static int ecc_cube_position(const hypercube* h, const request* r, boolean remove_holes) +static int ecc_cube_position(const hypercube* h, const request* r, bool remove_holes) { request* cube = h->cube; int c = count_axis(h); @@ -1627,7 +1624,7 @@ static void cube_indexes( int k = 0; int count = count_values(cube, axis); int last = h->index_cache[i]; - const boolean is_time_axis = (strcmp(axis, "time") == 0); + const bool is_time_axis = (strcmp(axis, "time") == 0); if (is_time_axis) { Assert(times_array); Assert(times_array_size == count); @@ -1669,7 +1666,7 @@ static hypercube* new_hypercube(const request* r) { hypercube* h = (hypercube*)calloc(sizeof(hypercube), 1); int total = 0, count = 0; - int n = 0; + size_t n = 0; const char* val = 0; Assert(h); h->r = clone_one_request(r); @@ -1850,10 +1847,10 @@ typedef struct filter_type double scale_factor; double add_offset; double missing; - boolean bitmap; + bool bitmap; ncatt_t att; request* filter_request; - boolean scale; + bool scale; } dataset_t; /* @@ -1865,19 +1862,19 @@ typedef struct filter_type typedef struct ncoptions { - boolean usevalidtime; /* Whether to use valid TIME only or not */ - boolean auto_refdate; /* Automatic Reference Date */ + bool usevalidtime; /* Whether to use valid TIME only or not */ + bool auto_refdate; /* Automatic Reference Date */ long refdate; /* Reference date */ const char* version; char* title; char* history; char* unlimited; - boolean checkvalidtime; + bool checkvalidtime; request* mars_description; - boolean mmeans; /* Whether this dataset is Monthly Means */ - boolean climatology; /* Whether this dataset is climatology */ - boolean shuffle; + bool mmeans; /* Whether this dataset is Monthly Means */ + bool climatology; /* Whether this dataset is climatology */ + bool shuffle; long deflate; } ncoptions_t; @@ -2020,7 +2017,7 @@ static void validation_time(request* r) date = atol(p); else { long second = 0; - boolean isjul, date_ok; + bool isjul, date_ok; date_ok = parsedate(p, &julian, &second, &isjul); if (!date_ok) grib_context_log(ctx, GRIB_LOG_ERROR, "Failed to parse date: '%s'", p); @@ -2031,9 +2028,9 @@ static void validation_time(request* r) if (strlen(p) == 3) { if (setup.usevalidtime) grib_context_log(ctx, GRIB_LOG_ERROR, "Climatology data. Setting usevalidtime=OFF"); - setup.auto_refdate = FALSE; - setup.usevalidtime = FALSE; - setup.climatology = TRUE; + setup.auto_refdate = false; + setup.usevalidtime = false; + setup.climatology = true; } } @@ -2103,11 +2100,11 @@ static void get_nc_options(const request* user_r) const char* history = get_value(user_r, "history", 0); const char* unlimited = get_value(user_r, "unlimited", 0); - setup.shuffle = shuffle ? (strcmp(shuffle, "true") == 0) : FALSE; + setup.shuffle = shuffle ? (strcmp(shuffle, "true") == 0) : false; setup.deflate = deflate ? ((strcmp(deflate, "none") == 0) ? -1 : atol(deflate)) : -1; - setup.usevalidtime = validtime ? (strcmp(validtime, "true") == 0) : FALSE; + setup.usevalidtime = validtime ? (strcmp(validtime, "true") == 0) : false; setup.refdate = refdate ? atol(refdate) : 19000101; - setup.auto_refdate = refdate ? (strcmp(get_value(user_r, "referencedate", 0), "AUTOMATIC") == 0) : FALSE; + setup.auto_refdate = refdate ? (strcmp(get_value(user_r, "referencedate", 0), "AUTOMATIC") == 0) : false; setup.title = title ? grib_context_strdup(ctx, (title)) : NULL; setup.history = history ? grib_context_strdup(ctx, (history)) : NULL; @@ -2266,7 +2263,7 @@ static int def_latlon(int ncid, fieldset* fs) n = nlats; set_dimension(ncid, "latitude", n, NC_FLOAT, "degrees_north", "latitude"); - /* g->purge_header = TRUE; */ + /* g->purge_header = true; */ release_field(g); return e; @@ -2275,7 +2272,7 @@ static int def_latlon(int ncid, fieldset* fs) static int put_latlon(int ncid, fieldset* fs) { int var_id = 0; - int i = 0; + size_t i = 0; size_t n = 0; int stat = 0; err e = 0; @@ -2364,7 +2361,7 @@ static int put_latlon(int ncid, fieldset* fs) stat = nc_put_var_float(ncid, var_id, fvalues); check_err("nc_put_var_float", stat, __LINE__); - /* g->purge_header = TRUE; */ + /* g->purge_header = true; */ release_field(g); grib_context_free(ctx, fvalues); grib_context_free(ctx, dvalues); @@ -2378,7 +2375,7 @@ static int compute_scale(dataset_t* subset) double min = DBL_MAX; double median = 0; long i = 0; - long j = 0; + size_t j = 0; int64_t scaled_max = 0; int64_t scaled_min = 0; int64_t scaled_median = 0; @@ -2417,7 +2414,7 @@ static int compute_scale(dataset_t* subset) } if (g->has_bitmap) { - subset->bitmap = TRUE; + subset->bitmap = true; for (j = 0; j < len; ++j) { if (vals && vals[j] != global_missing_value) { if (vals[j] > max) max = vals[j]; @@ -2433,7 +2430,7 @@ static int compute_scale(dataset_t* subset) } } } - /* g->purge_header = TRUE; */ + /* g->purge_header = true; */ release_field(g); } @@ -2754,7 +2751,7 @@ static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset) field* f = get_field(fs, 0, expand_mem); void* vscaled = NULL; - long vscaled_length = 0; + size_t vscaled_length = 0; long ni; long nj; @@ -2782,7 +2779,7 @@ static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset) count[naxis] = nj; /* latitude */ count[naxis + 1] = ni; /* longitude */ - /* f->purge_header = TRUE; */ + /* f->purge_header = true; */ release_field(f); stat = nc_inq_varid(ncid, name, &dataid); @@ -2797,7 +2794,7 @@ static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset) size_t len; static double* vals = NULL; static size_t vals_len = 0; - boolean missing = 0; + bool missing = 0; request* r; int j = 0; @@ -2821,7 +2818,7 @@ static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset) } #if 0 - boolean missing = (g->ksec4[0] < 0); /* If negative number of values, field is missing */ + bool missing = (g->ksec4[0] < 0); /* If negative number of values, field is missing */ #endif r = field_to_request(g); @@ -2865,7 +2862,7 @@ static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset) check_err("nc_put_vara_type", stat, __LINE__); } - /* g->purge_header = TRUE; */ + /* g->purge_header = true; */ release_field(g); } @@ -2993,7 +2990,7 @@ static int define_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid, datase } if (strcmp(axis, "time") == 0) { - boolean onedtime = (count_values(cube, "date") == 0 && count_values(cube, "step") == 0); + bool onedtime = (count_values(cube, "date") == 0 && count_values(cube, "step") == 0); snprintf(u, sizeof(u), "hours since 0000-00-00 00:00:00.0"); longname = "reference_time"; if (setup.usevalidtime || onedtime) { @@ -3370,7 +3367,7 @@ static void print_ignored_keys(FILE* f, request* data) #define NO_TABLE -1 #define NO_PARAM 0 -static void paramtable(const char* p, long* param, long* table, boolean paramIdMode) +static void paramtable(const char* p, long* param, long* table, bool paramIdMode) { const char* q = p; int len = strlen(p); @@ -3406,7 +3403,7 @@ static void find_nc_attributes(const request* subset_r, const request* user_r, n { const char* split = NULL; int j = 0; - boolean set_param_as_name = TRUE; + bool set_param_as_name = true; long datatable = 0; /* = atol(get_value(data_r,"_CODETABLE2",0)); */ if (count_values(user_r, "split") == 0) @@ -3415,18 +3412,18 @@ static void find_nc_attributes(const request* subset_r, const request* user_r, n while ((split = get_value(user_r, "split", j++)) != NULL) { if (strcmp(split, "param") != 0) { if (count_values(data_r, split) > 1) - set_param_as_name = FALSE; + set_param_as_name = false; } } j = 0; while ((split = get_value(user_r, "split", j++)) != NULL) { - boolean found = FALSE; + bool found = false; request* cfg = (request*)config_r; - boolean is_param = strcmp(split, "param") == 0; + bool is_param = strcmp(split, "param") == 0; /* Only use this parameter in the name if there is more than one value in the original request or if param */ - boolean setname = ((count_values(data_r, split) > 1) || (is_param && set_param_as_name)); + bool setname = ((count_values(data_r, split) > 1) || (is_param && set_param_as_name)); while (cfg) { const char* cfgname = get_value(cfg, "NAME", 0); @@ -3441,7 +3438,7 @@ static void find_nc_attributes(const request* subset_r, const request* user_r, n long cfgparam = atol(cfgval); long dataparam = atol(dataval); - paramtable(dataval, &dataparam, &datatable, FALSE); + paramtable(dataval, &dataparam, &datatable, false); /* If it is not param and they're EXACTLY equal or being param, they're the same parameter and table */ @@ -3473,7 +3470,7 @@ static void find_nc_attributes(const request* subset_r, const request* user_r, n strcat(att->name, "_"); strcat(att->name, pname); } - found = TRUE; + found = true; grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: Var. name found: '%s'", att->name); } @@ -3516,7 +3513,7 @@ static void reqcb(const request* r, int count, axis_t* names, char* vals[], void w->order = (*n)++; for (i = 0; i < count; i++) { if (vals[i]) - put_value(w, names[i].name, vals[i], FALSE, FALSE, FALSE); + put_value(w, names[i].name, vals[i], false, false, false); } if (first == NULL) @@ -3526,12 +3523,12 @@ static void reqcb(const request* r, int count, axis_t* names, char* vals[], void last = w; } -static boolean chk_152(int count, axis_t* names, char* vals[]) +static bool chk_152(int count, axis_t* names, char* vals[]) { - return TRUE; + return true; } -static void loop(const request* r, boolean ml, int index, int count, axis_t* strings, char* values[], loopproc callback, void* data) +static void loop(const request* r, bool ml, int index, int count, axis_t* strings, char* values[], loopproc callback, void* data) { if (index < count) { parameter* p = find_parameter(r, strings[index].name); @@ -3560,14 +3557,14 @@ static void values_loop(const request* r, int count, axis_t* parnames, loopproc { char** values = (char**)grib_context_malloc(ctx, sizeof(char*) * count); const char* p = get_value(r, "levtype", 0); - boolean ml = (boolean)(p && (strcmp(p, "ml") == 0)); + bool ml = (bool)(p && (strcmp(p, "ml") == 0)); if (ml) { p = get_value(r, "expect", 0); if (p && atol(p) != 0) { grib_context_log(ctx, GRIB_LOG_ERROR, "EXPECT provided, special treatment of LNSP"); grib_context_log(ctx, GRIB_LOG_ERROR, "and other single level parameters disabled"); - ml = FALSE; + ml = false; } } @@ -3622,14 +3619,14 @@ static int split_fieldset(fieldset* fs, request* data_r, dataset_t** subsets, co filters[i].fset = new_fieldset(1); filters[i].count = 0; filters[i].filter_request = clone_one_request(s); - filters[i].bitmap = FALSE; - /* filters[i].mmeans = FALSE; */ + filters[i].bitmap = false; + /* filters[i].mmeans = false; */ s = s->next; } for (i = 0; i < fs->count; ++i) { - boolean ok = FALSE; + bool ok = false; field* f = get_field(fs, i, packed_mem); request* g = field_to_request(f); int j = 0; @@ -3660,13 +3657,13 @@ static int split_fieldset(fieldset* fs, request* data_r, dataset_t** subsets, co print_hypercube(filters[0].filter); exit(1); } - /* f->purge_header = TRUE; */ + /* f->purge_header = true; */ release_field(f); } for (i = 0; i < count; ++i) { filters[i].att.nctype = nctype; - filters[i].scale = TRUE; + filters[i].scale = true; filters[i].missing = nc_type_values[nctype].nc_type_missing; find_nc_attributes(filters[i].filter_request, user_r, &(filters[i].att), config_r, data_r); grib_context_log(ctx, GRIB_LOG_DEBUG, "grib_to_netcdf: filter[%d] found.- Var. name '%s', nctype: %d, found nctype: %d", i, filters[i].att.name, nctype, filters[i].att.nctype); @@ -3680,10 +3677,10 @@ static int split_fieldset(fieldset* fs, request* data_r, dataset_t** subsets, co switch (filters[i].att.nctype) { case NC_FLOAT: case NC_DOUBLE: - filters[i].scale = FALSE; + filters[i].scale = false; break; default: - filters[i].scale = TRUE; + filters[i].scale = true; break; } } @@ -3740,17 +3737,17 @@ static int convert_month(const char* pMonthString) return -1; /*Failed*/ } -static boolean parsedate(const char* name, long* julian, long* second, boolean* isjul) +static bool parsedate(const char* name, long* julian, long* second, bool* isjul) { const char* p = name; int n; int y = 0, m = 0, d = 0, H = 0, M = 0, S = 0; *julian = *second = 0; - *isjul = FALSE; + *isjul = false; if (p == 0 || *p == 0) - return FALSE; + return false; /* Special ERA Interim grib1 date format: jul-21, sep-02 etc * See GRIB-416 @@ -3764,29 +3761,29 @@ static boolean parsedate(const char* name, long* julian, long* second, boolean* y = 1900; /* no year specified */ m = convert_month(month); if (m == -1) - return FALSE; + return false; *julian = grib_date_to_julian(y * 10000 + m * 100 + day); *second = 0; - return TRUE; + return true; } } /* year */ p = parse1(p, &y, &n); if (n != 2 && n != 4) /* year string must be 2 or 4 characters long: 93 or 1993 */ - return FALSE; + return false; if (*p++ != '-') - return FALSE; + return false; /* month */ p = parse1(p, &m, &n); if (n == 2) { /* day */ if (*p++ != '-') - return FALSE; + return false; p = parse1(p, &d, &n); if (n != 2) - return FALSE; + return false; } else if (n == 3) { long j = grib_date_to_julian(y * 10000 + 101) + m - 1; @@ -3794,13 +3791,13 @@ static boolean parsedate(const char* name, long* julian, long* second, boolean* /* julian day */; d = j % 100; m = (j % 10000) / 100; - *isjul = TRUE; + *isjul = true; } else - return FALSE; + return false; if (m == 0 || m > 12) { - return FALSE; /* month out of range */ + return false; /* month out of range */ } while (*p && isspace(*p)) @@ -3810,53 +3807,53 @@ static boolean parsedate(const char* name, long* julian, long* second, boolean* p = parse1(p, &H, &n); if (n != 0) { if (n != 2) - return FALSE; + return false; /* minute */ if (*p++ != ':') - return FALSE; + return false; p = parse1(p, &M, &n); if (n != 2) - return FALSE; + return false; if (*p != 0) { /* second */ if (*p++ != ':') - return FALSE; + return false; p = parse1(p, &S, &n); if (n != 2) - return FALSE; + return false; } } *julian = grib_date_to_julian(y * 10000 + m * 100 + d); *second = H * 3600 + M * 60 + S; - return *p == 0 ? TRUE : FALSE; + return *p == 0 ? true : false; } -static boolean check_dimension_name(const char* dim) +static bool check_dimension_name(const char* dim) { /* Dimension name must begin with an alphabetic character, followed by zero * or more alphanumeric characters including the underscore */ int i = 0, len = 0; if (!dim) - return FALSE; + return false; len = strlen(dim); if (len == 0) - return FALSE; + return false; if (!isalpha(dim[0])) - return FALSE; + return false; for (i = 1; i < len; ++i) { const char c = dim[i]; const int ok = isalnum(c) || c == '_'; if (!ok) - return FALSE; + return false; } - return TRUE; + return true; } static int get_creation_mode(int option_kind) @@ -4173,7 +4170,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil if (i == 1) { const char* mmeans = get_value(r, "_MONTHLY_MEANS", 0); - setup.mmeans = mmeans ? (atol(mmeans) == 1) : FALSE; + setup.mmeans = mmeans ? (atol(mmeans) == 1) : false; } fcmonth2nbmonths(r); @@ -4186,7 +4183,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil setup.refdate = atol(p); else { long julian = 0, second = 0; - boolean isjul; + bool isjul; parsedate(p, &julian, &second, &isjul); setup.refdate = grib_julian_to_date(julian); } From 18c0dae5f53e3f6b2572f3b3ec29086ed80e2b4b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Mar 2023 15:12:24 +0000 Subject: [PATCH 130/212] Compiler warnings: comparison of integers of different signs [-Wsign-compare] --- src/grib_accessor_class_apply_operators.cc | 4 ++-- src/grib_accessor_class_blob.cc | 2 +- src/grib_accessor_class_bufr_data_element.cc | 10 +++++----- src/grib_accessor_class_bytes.cc | 4 ++-- src/grib_accessor_class_hash_array.cc | 6 +++--- src/grib_iterator_class.cc | 2 +- src/grib_util.cc | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/grib_accessor_class_apply_operators.cc b/src/grib_accessor_class_apply_operators.cc index 2f7c9a5d3..ed24a495c 100644 --- a/src/grib_accessor_class_apply_operators.cc +++ b/src/grib_accessor_class_apply_operators.cc @@ -263,7 +263,7 @@ static int get_native_type(grib_accessor* a) size_t compute_size_AO(const long* descriptors, size_t numberOfDescriptors) { - int i = 0; + size_t i = 0; size_t sizeAO = numberOfDescriptors; int extraElement = 0; int X, F, Y; @@ -653,7 +653,7 @@ static int unpack_string_array(grib_accessor* a, char** val, size_t* len) { grib_accessor_apply_operators* self = (grib_accessor_apply_operators*)a; int ret = 0; - int i = 0; + size_t i = 0; grib_context* c = a->context; ret = apply_operators(a); diff --git a/src/grib_accessor_class_blob.cc b/src/grib_accessor_class_blob.cc index 841f15209..81480923e 100644 --- a/src/grib_accessor_class_blob.cc +++ b/src/grib_accessor_class_blob.cc @@ -143,7 +143,7 @@ static int get_native_type(grib_accessor* a) static int unpack_bytes(grib_accessor* a, unsigned char* buffer, size_t* len) { - if (*len < a->length) { + if (*len < (size_t)a->length) { *len = a->length; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_bufr_data_element.cc b/src/grib_accessor_class_bufr_data_element.cc index 75efd13e6..d3983aa6a 100644 --- a/src/grib_accessor_class_bufr_data_element.cc +++ b/src/grib_accessor_class_bufr_data_element.cc @@ -448,7 +448,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) value_count(a, &count); - if (*len < count) + if (*len < (size_t)count) return GRIB_ARRAY_TOO_SMALL; if (self->compressedData) { @@ -477,7 +477,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) value_count(a, &count); - if (*len < count) + if (*len < (size_t)count) return GRIB_ARRAY_TOO_SMALL; if (self->compressedData) { @@ -589,11 +589,11 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { /* ECC-415 */ grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a; - int ret = GRIB_SUCCESS; - long count = 0; + int ret = GRIB_SUCCESS; + long count = 0; value_count(a, &count); - if (idx >= count) { + if (idx >= (size_t)count) { return GRIB_INTERNAL_ERROR; } diff --git a/src/grib_accessor_class_bytes.cc b/src/grib_accessor_class_bytes.cc index 5ecf84ad0..47eb1e4a0 100644 --- a/src/grib_accessor_class_bytes.cc +++ b/src/grib_accessor_class_bytes.cc @@ -159,11 +159,11 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) { unsigned char* p = NULL; char* s = v; - int i; + long i = 0; const long length = grib_byte_count(a); const long slength = 2 * length; - if (*len < slength) { + if (*len < (size_t)slength) { *len = slength; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_hash_array.cc b/src/grib_accessor_class_hash_array.cc index 8e330c7b1..7ab75323a 100644 --- a/src/grib_accessor_class_hash_array.cc +++ b/src/grib_accessor_class_hash_array.cc @@ -234,10 +234,10 @@ static grib_hash_array_value* find_hash_value(grib_accessor* a, int* err) static int unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_hash_array_value* ha = 0; + grib_hash_array_value* ha = 0; grib_accessor_hash_array* self = (grib_accessor_hash_array*)a; - int err = 0; - int i; + int err = 0; + size_t i = 0; if (!self->ha) { ha = find_hash_value(a, &err); diff --git a/src/grib_iterator_class.cc b/src/grib_iterator_class.cc index c3902893b..0197a09a4 100644 --- a/src/grib_iterator_class.cc +++ b/src/grib_iterator_class.cc @@ -33,7 +33,7 @@ static const struct table_entry table[] = { grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* ret) { - int i; + size_t i = 0; const char* type = (char*)grib_arguments_get_name(h, args, 0); for (i = 0; i < NUMBER(table); i++) diff --git a/src/grib_util.cc b/src/grib_util.cc index b5e45c858..735df66a2 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -808,7 +808,7 @@ static const char* get_grid_type_name(const int spec_grid_type) static int is_constant_field(const double missingValue, const double* data_values, size_t data_values_count) { - int ii = 0; + size_t ii = 0; int constant = 1; double value = missingValue; From 0c2060e58572be8044459ede88891059b8242f92 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 4 Mar 2023 18:51:14 +0000 Subject: [PATCH 131/212] Compiler warnings: comparison of integers of different signs [-Wsign-compare] --- tools/gts_compare.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 9bb380fc3..e0237af03 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -665,7 +665,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_h save_error(c, name); } if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS && len1 == len2) { - int i; + size_t i; countdiff = 0; for (i = 0; i < len1; i++) if (lval1[i] != lval2[i]) @@ -726,7 +726,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_h if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) { if (memcmp(uval1, uval2, len1) != 0) { - int i; + size_t i; for (i = 0; i < len1; i++) if (uval1[i] != uval2[i]) { printInfo(h1); @@ -735,7 +735,7 @@ static int compare_values(grib_runtime_options* options, grib_handle* h1, grib_h printf("[%s] byte values are different: [%02x] and [%02x]\n", name, uval1[i], uval2[i]); else - printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n", + printf("[%s] byte value %zu of %ld are different: [%02x] and [%02x]\n", name, i, (long)len1, uval1[i], uval2[i]); err1 = GRIB_VALUE_MISMATCH; From dbfd6ca9cdbd74c71c46ec8b4bd7dd0ee7f5dd76 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 5 Mar 2023 20:33:56 +0000 Subject: [PATCH 132/212] Migration to C++: Use builtin bool type --- src/bufr_util.cc | 6 +- src/grib_accessor_class_bufr_data_array.cc | 16 ++-- src/grib_accessor_class_data_png_packing.cc | 9 +- src/grib_nearest_class_regular.cc | 8 +- src/grib_util.cc | 99 ++++++++++----------- 5 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/bufr_util.cc b/src/bufr_util.cc index 6c9dfa9f1..fb7cea585 100644 --- a/src/bufr_util.cc +++ b/src/bufr_util.cc @@ -211,7 +211,7 @@ static int bufr_decode_rdb_keys(const void* message, long offset_section2, codes /* The ECMWF BUFR local use section */ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, codes_bufr_header* hdr) { - int isSatelliteType = 0; + bool isSatelliteType = false; long start = 0; const long offset_keyData = offset_section2 + 6; const long offset_keyMore = offset_section2 + 19; /* 8 bytes long */ @@ -223,7 +223,7 @@ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, DebugAssert(hdr->ecmwfLocalSectionPresent); if (hdr->rdbType == 2 || hdr->rdbType == 3 || hdr->rdbType == 8 || hdr->rdbType == 12) { - isSatelliteType = 1; + isSatelliteType = true; } if (isSatelliteType || hdr->numberOfSubsets > 1) { hdr->isSatellite = 1; @@ -844,7 +844,7 @@ static char* codes_bufr_header_get_centre_name(long edition, long centre_code) int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* val, size_t* len) { static const char* NOT_FOUND = "not_found"; - int isEcmwfLocal = 0; + bool isEcmwfLocal = false; Assert(bh); Assert(key); *len = strlen(NOT_FOUND); /*By default*/ diff --git a/src/grib_accessor_class_bufr_data_array.cc b/src/grib_accessor_class_bufr_data_array.cc index 6c28403e7..546950e7e 100644 --- a/src/grib_accessor_class_bufr_data_array.cc +++ b/src/grib_accessor_class_bufr_data_array.cc @@ -808,8 +808,8 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu double min = 0, max = 0, maxAllowed, minAllowed; double* v = NULL; double* values = NULL; - int thereIsAMissing = 0; - int is_constant; + bool thereIsAMissing = false; + bool is_constant = true; double val0; /* ECC-379, ECC-830 */ const int dont_fail_if_out_of_range = self->set_to_missing_if_out_of_range; @@ -874,16 +874,16 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu return GRIB_ARRAY_TOO_SMALL; values = (double*)grib_context_malloc_clear(c, sizeof(double) * nvals); val0 = dvalues->v[self->iss_list->v[0]]; - is_constant = 1; + is_constant = true; for (i = 0; i < nvals; i++) { values[i] = dvalues->v[self->iss_list->v[i]]; if (val0 != values[i]) - is_constant = 0; + is_constant = false; } v = values; /* encoding a range with constant values*/ - if (is_constant == 1) { + if (is_constant) { localWidth = 0; grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + modifiedWidth); if (*v == GRIB_MISSING_DOUBLE) { @@ -901,7 +901,7 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu ii = 0; while (ii < nvals && *v == GRIB_MISSING_DOUBLE) { - thereIsAMissing = 1; + thereIsAMissing = true; v++; ii++; } @@ -942,7 +942,7 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu index_of_max = ii; } if (*v == GRIB_MISSING_DOUBLE) - thereIsAMissing = 1; + thereIsAMissing = true; ii++; v++; } @@ -972,7 +972,7 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu localWidth++; } else { - if (thereIsAMissing == 1) + if (thereIsAMissing) localWidth = 1; else localWidth = 0; diff --git a/src/grib_accessor_class_data_png_packing.cc b/src/grib_accessor_class_data_png_packing.cc index 455a26dbb..dc803cc70 100644 --- a/src/grib_accessor_class_data_png_packing.cc +++ b/src/grib_accessor_class_data_png_packing.cc @@ -372,15 +372,15 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return err; } -static int is_constant(const double* values, size_t n_vals) +static bool is_constant(const double* values, size_t n_vals) { - int isConstant = 1; + bool isConstant = true; double v = 0; size_t i; for (i = 0; i < n_vals; i++) { if (i == 0) v = values[i]; else if (v != values[i]) { - isConstant = 0; + isConstant = false; break; } } @@ -391,7 +391,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_data_png_packing* self = (grib_accessor_data_png_packing*)a; - int err = GRIB_SUCCESS, is_constant_field = 0; + int err = GRIB_SUCCESS; + bool is_constant_field = false; int i, j; size_t buflen = 0; diff --git a/src/grib_nearest_class_regular.cc b/src/grib_nearest_class_regular.cc index 25cf38347..ab2793181 100644 --- a/src/grib_nearest_class_regular.cc +++ b/src/grib_nearest_class_regular.cc @@ -213,13 +213,13 @@ static int find(grib_nearest* nearest, grib_handle* h, return GRIB_SUCCESS; } #else -static int is_rotated_grid(grib_handle* h) +static bool is_rotated_grid(grib_handle* h) { long is_rotated = 0; int err = grib_get_long(h, "isRotatedGrid", &is_rotated); if (!err && is_rotated) - return 1; - return 0; + return true; + return false; } static int find(grib_nearest* nearest, grib_handle* h, @@ -234,7 +234,7 @@ static int find(grib_nearest* nearest, grib_handle* h, grib_iterator* iter = NULL; double lat = 0, lon = 0; - const int is_rotated = is_rotated_grid(h); + const bool is_rotated = is_rotated_grid(h); double angleOfRotation = 0, southPoleLat = 0, southPoleLon = 0; while (inlon < 0) diff --git a/src/grib_util.cc b/src/grib_util.cc index 735df66a2..3ffd94f2f 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1716,7 +1716,7 @@ int grib_moments(grib_handle* h, double east, double north, double west, double } #endif -/* Helper function for 'parse_keyval_string' */ +// Helper function for 'parse_keyval_string' static void set_value(grib_values* value, char* str, int equal) { char *p = 0, *q = 0, *s = 0; @@ -1802,14 +1802,14 @@ static void set_value(grib_values* value, char* str, int equal) } } -/* - 'grib_tool' Optional tool name which is printed on error. Can be NULL - 'arg' The string to be parsed e.g. key1=value1,key2!=value2 etc (cannot be const) - 'values_required' If true then each key must have a value after it - 'default_type' The default type e.g. GRIB_TYPE_UNDEFINED or GRIB_TYPE_DOUBLE - 'values' The array we populate and return (output) - 'count' Number of elements (output). Must be initialised to the size of the values array - */ +// +// 'grib_tool' Optional tool name which is printed on error. Can be NULL +// 'arg' The string to be parsed e.g. key1=value1,key2!=value2 etc (cannot be const) +// 'values_required' If true then each key must have a value after it +// 'default_type' The default type e.g. GRIB_TYPE_UNDEFINED or GRIB_TYPE_DOUBLE +// 'values' The array we populate and return (output) +// 'count' Number of elements (output). Must be initialised to the size of the values array +// int parse_keyval_string(const char* grib_tool, char* arg, int values_required, int default_type, grib_values values[], int* count) @@ -1890,18 +1890,18 @@ int parse_keyval_string(const char* grib_tool, return GRIB_SUCCESS; } -/* Return 1 if the productDefinitionTemplateNumber (GRIB2) is related to EPS */ +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is related to EPS int grib2_is_PDTN_EPS(long pdtn) { return ( pdtn == 1 || pdtn == 11 || - pdtn == 33 || pdtn == 34 || /*simulated (synthetic) satellite data*/ - pdtn == 41 || pdtn == 43 || /*atmospheric chemical constituents*/ - pdtn == 45 || pdtn == 47 || pdtn == 85 /*aerosols*/ + pdtn == 33 || pdtn == 34 || // simulated (synthetic) satellite data + pdtn == 41 || pdtn == 43 || // atmospheric chemical constituents + pdtn == 45 || pdtn == 47 || pdtn == 85 // aerosols ); } -/* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for atmospheric chemical constituents */ +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for atmospheric chemical constituents int grib2_is_PDTN_Chemical(long pdtn) { return ( @@ -1911,8 +1911,8 @@ int grib2_is_PDTN_Chemical(long pdtn) pdtn == 43); } -/* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for - * atmospheric chemical constituents with source or sink */ +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for +// atmospheric chemical constituents with source or sink int grib2_is_PDTN_ChemicalSourceSink(long pdtn) { return ( @@ -1922,8 +1922,8 @@ int grib2_is_PDTN_ChemicalSourceSink(long pdtn) pdtn == 79); } -/* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for - * atmospheric chemical constituents based on a distribution function */ +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for +// atmospheric chemical constituents based on a distribution function int grib2_is_PDTN_ChemicalDistFunc(long pdtn) { return ( @@ -1933,11 +1933,11 @@ int grib2_is_PDTN_ChemicalDistFunc(long pdtn) pdtn == 68); } -/* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for aerosols */ +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for aerosols int grib2_is_PDTN_Aerosol(long pdtn) { - /* Notes: PDT 44 is deprecated and replaced by 48 */ - /* PDT 47 is deprecated and replaced by 85 */ + // Notes: PDT 44 is deprecated and replaced by 48 + // PDT 47 is deprecated and replaced by 85 return ( pdtn == 44 || pdtn == 48 || @@ -1948,23 +1948,22 @@ int grib2_is_PDTN_Aerosol(long pdtn) pdtn == 85); } -/* Return 1 if the productDefinitionTemplateNumber (GRIB2) is for optical properties of aerosol */ +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for optical properties of aerosol int grib2_is_PDTN_AerosolOptical(long pdtn) { - /* Note: PDT 48 can be used for both plain aerosols as well as optical properties of aerosol. - * For the former user must set the optical wavelength range to missing. - */ + // Note: PDT 48 can be used for both plain aerosols as well as optical properties of aerosol. + // For the former user must set the optical wavelength range to missing return ( pdtn == 48 || pdtn == 49); } -/* Given some information about the type of grib2 parameter, return the productDefinitionTemplateNumber to use. - * All arguments are booleans (0 or 1) - * is_eps: ensemble or deterministic - * is_instant: instantaneous or interval-based - * etc - */ +// Given some information about the type of grib2 parameter, return the productDefinitionTemplateNumber to use. +// All arguments are booleans (0 or 1) +// is_eps: ensemble or deterministic +// is_instant: instantaneous or interval-based +// etc... +// int grib2_select_PDTN(int is_eps, int is_instant, int is_chemical, int is_chemical_srcsink, @@ -1972,8 +1971,8 @@ int grib2_select_PDTN(int is_eps, int is_instant, int is_aerosol, int is_aerosol_optical) { - /* At most one has to be set. All could be 0 */ - /* Unfortunately if PDTN=48 then both aerosol and aerosol_optical can be 1! */ + // At most one has to be set. All could be 0 + // Unfortunately if PDTN=48 then both aerosol and aerosol_optical can be 1! const int sum = is_chemical + is_chemical_srcsink + is_chemical_distfn + is_aerosol + is_aerosol_optical; Assert(sum == 0 || sum == 1 || sum == 2); @@ -2026,12 +2025,12 @@ int grib2_select_PDTN(int is_eps, int is_instant, if (is_eps) { if (is_instant) return 49; - /* WMO does not have a non-instantaneous case here! */ + // WMO does not have a non-instantaneous case here! } else { if (is_instant) return 48; - /* WMO does not have a non-instantaneous case here! */ + // WMO does not have a non-instantaneous case here! } } @@ -2040,17 +2039,17 @@ int grib2_select_PDTN(int is_eps, int is_instant, if (is_instant) return 45; else - return 85; /* PDT 47 is deprecated*/ + return 85; // PDT 47 is deprecated } else { if (is_instant) - return 48; /*44 is deprecated*/ + return 48; // 44 is deprecated else return 46; } } - /* Fallthru case: default */ + // Fallthru case: default if (is_eps) { if (is_instant) return 1; @@ -2098,7 +2097,7 @@ int grib_check_data_values_range(grib_handle* h, const double min_val, const dou return GRIB_ENCODING_ERROR; } - /* Data Quality checks */ + // Data Quality checks if (ctx->grib_data_quality_checks) { result = grib_util_grib_data_quality_check(h, min_val, max_val); } @@ -2106,10 +2105,10 @@ int grib_check_data_values_range(grib_handle* h, const double min_val, const dou return result; } -/* Return true(1) if large constant fields are to be created, otherwise false(0) */ +// Return true(1) if large constant fields are to be created, otherwise false(0) int grib_producing_large_constant_fields(grib_handle* h, int edition) { - /* First check if the transient key is set */ + // First check if the transient key is set grib_context* c = h->context; long produceLargeConstantFields = 0; if (grib_get_long(h, "produceLargeConstantFields", &produceLargeConstantFields) == GRIB_SUCCESS && @@ -2121,7 +2120,7 @@ int grib_producing_large_constant_fields(grib_handle* h, int edition) return 1; } - /* Finally check the environment variable via the context */ + // Finally check the environment variable via the context return c->large_constant_fields; } @@ -2132,18 +2131,18 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max double min_field_value_allowed = 0, max_field_value_allowed = 0; long paramId = 0; grib_context* ctx = h->context; - int is_error = 1; + bool is_error = true; char description[1024] = {0,}; char step[32] = "unknown"; size_t len = 32; - /* - * If grib_data_quality_checks == 1, limits failure results in an error - * If grib_data_quality_checks == 2, limits failure results in a warning - */ + + // If grib_data_quality_checks == 1, limits failure results in an error + // If grib_data_quality_checks == 2, limits failure results in a warning + Assert(ctx->grib_data_quality_checks == 1 || ctx->grib_data_quality_checks == 2); is_error = (ctx->grib_data_quality_checks == 1); - /* The limit keys must exist if we are here */ + // The limit keys must exist if we are here err = grib_get_double(h, "param_value_min", &min_field_value_allowed); if (err) { grib_context_log(ctx, GRIB_LOG_ERROR, "grib_data_quality_check: Could not get param_value_min"); @@ -2177,7 +2176,7 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max } } if (is_error) { - return GRIB_OUT_OF_RANGE; /* Failure */ + return GRIB_OUT_OF_RANGE; // Failure } } if (max_val > max_field_value_allowed) { @@ -2193,7 +2192,7 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max } } if (is_error) { - return GRIB_OUT_OF_RANGE; /* Failure */ + return GRIB_OUT_OF_RANGE; // Failure } } From 578493bd776d27599c86404394daa4276401a6ab Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Mar 2023 12:32:21 +0000 Subject: [PATCH 133/212] Testing: projString for other grid types --- tests/grib_proj_string.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/grib_proj_string.sh b/tests/grib_proj_string.sh index e41c02d4e..676f31492 100755 --- a/tests/grib_proj_string.sh +++ b/tests/grib_proj_string.sh @@ -10,6 +10,11 @@ . ./include.ctest.sh +label="grib_proj_string_test" +tempGrib=temp.$label.grib +tempText=temp.$label.txt +grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + files=" mercator.grib2 satellite.grib @@ -39,3 +44,19 @@ for f in `echo $files`; do $PROJ_TOOL $ps fi done + +# Various grids +${tools_dir}/grib_set -s gridType=lambert_azimuthal_equal_area $grib2_sample $tempGrib +${tools_dir}/grib_get -p projString $tempGrib > $tempText +grep -q "proj=laea" $tempText + +${tools_dir}/grib_set -s gridType=lambert $grib2_sample $tempGrib +${tools_dir}/grib_get -p projString $tempGrib > $tempText +grep -q "proj=lcc" $tempText + +${tools_dir}/grib_set -s gridType=polar_stereographic $grib2_sample $tempGrib +${tools_dir}/grib_get -p projString $tempGrib > $tempText +grep -q "proj=stere" $tempText + + +rm -f $tempGrib $tempText From 3079588f3ea63e81fd94964bb8b876068609363c Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 6 Mar 2023 14:41:23 +0000 Subject: [PATCH 134/212] ECC-1467: Simplification of templates --- src/grib_accessor.cc | 16 +- src/grib_accessor_class_bitmap.cc | 45 ++- src/grib_accessor_class_data_apply_bitmap.cc | 117 ++++++- src/grib_accessor_class_data_apply_bitmap.h | 109 ------- ...cessor_class_data_apply_boustrophedonic.cc | 19 +- src/grib_accessor_class_data_ccsds_packing.cc | 164 +++++++++- src/grib_accessor_class_data_ccsds_packing.h | 163 ---------- ...rib_accessor_class_data_complex_packing.cc | 278 +++++++++++++++- ...grib_accessor_class_data_complex_packing.h | 268 ---------------- ...ib_accessor_class_data_g22order_packing.cc | 302 +++++++++++++++++- ...rib_accessor_class_data_g22order_packing.h | 295 ----------------- src/grib_accessor_class_data_raw_packing.cc | 1 + ...grib_accessor_class_data_simple_packing.cc | 110 +++---- src/grib_accessor_class_gen.cc | 90 ++++-- src/grib_api_internal_cpp.h | 1 + src/grib_bits_any_endian_simple.h | 8 +- src/grib_value.cc | 88 +++-- src/grib_value.h | 4 +- tests/grib_ecc-1467.cc | 6 +- tests/grib_ecc-1467.sh | 2 +- 20 files changed, 1072 insertions(+), 1014 deletions(-) delete mode 100644 src/grib_accessor_class_data_apply_bitmap.h delete mode 100644 src/grib_accessor_class_data_ccsds_packing.h delete mode 100644 src/grib_accessor_class_data_complex_packing.h delete mode 100644 src/grib_accessor_class_data_g22order_packing.h diff --git a/src/grib_accessor.cc b/src/grib_accessor.cc index 82bedf11f..e1e8c6dcc 100644 --- a/src/grib_accessor.cc +++ b/src/grib_accessor.cc @@ -14,7 +14,7 @@ * * ***************************************************************************/ -#include "grib_api_internal.h" +#include "grib_accessor.h" /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ @@ -233,7 +233,19 @@ int grib_unpack_float(grib_accessor* a, float* v, size_t* len) c = c->super ? *(c->super) : NULL; } DebugAssert(0); - return GRIB_NOT_IMPLEMENTED; + return 0; +} + +template <> +int grib_unpack(grib_accessor* a, double* v, size_t* len) +{ + return grib_unpack_double(a, v, len); +} + +template <> +int grib_unpack(grib_accessor* a, float* v, size_t* len) +{ + return grib_unpack_float(a, v, len); } int grib_unpack_double_element(grib_accessor* a, size_t i, double* v) diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc index 773897401..b0d49661f 100644 --- a/src/grib_accessor_class_bitmap.cc +++ b/src/grib_accessor_class_bitmap.cc @@ -40,8 +40,8 @@ or edit "accessor.class" and rerun ./make_class.pl */ -//static int unpack_double(grib_accessor*, double* val, size_t* len); -//static int unpack_float(grib_accessor*, float* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static long next_offset(grib_accessor*); @@ -89,8 +89,8 @@ static grib_accessor_class _grib_accessor_class_bitmap = { &unpack_long, /* grib_unpack procedures long */ 0, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &GribAccessorClassBitmap::unpack, /* grib_unpack procedures double */ - &GribAccessorClassBitmap::unpack, /* grib_unpack procedures float */ + &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ &unpack_string, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -247,6 +247,43 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } +template +int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating points numbers"); + long pos = a->offset * 8; + long tlen; + long i; + int err = 0; + grib_handle* hand = grib_handle_of_accessor(a); + + err = grib_value_count(a, &tlen); + if (err) + return err; + + if (*len < tlen) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); + *len = 0; + return GRIB_ARRAY_TOO_SMALL; + } + + for (i = 0; i < tlen; i++) { + val[i] = (T)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); + } + *len = tlen; + return GRIB_SUCCESS; +} + +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} + static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { long pos = a->offset * 8; diff --git a/src/grib_accessor_class_data_apply_bitmap.cc b/src/grib_accessor_class_data_apply_bitmap.cc index 9f8881399..5ba13e1a4 100644 --- a/src/grib_accessor_class_data_apply_bitmap.cc +++ b/src/grib_accessor_class_data_apply_bitmap.cc @@ -8,8 +8,9 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" -#include "grib_accessor_class_data_apply_bitmap.h" +#include "grib_api_internal_cpp.h" +#include +#include /* This is used by make_class.pl @@ -44,6 +45,9 @@ or edit "accessor.class" and rerun ./make_class.pl static int get_native_type(grib_accessor*); static int pack_double(grib_accessor*, const double* val, size_t* len); +template static int unpack(grib_accessor* a, T* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); @@ -51,6 +55,18 @@ static void init_class(grib_accessor_class*); static int unpack_double_element(grib_accessor*, size_t i, double* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); +typedef struct grib_accessor_data_apply_bitmap +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in data_apply_bitmap */ + const char* coded_values; + const char* bitmap; + const char* missing_value; + const char* number_of_data_points; + const char* number_of_values; + const char* binary_scale_factor; +} grib_accessor_data_apply_bitmap; extern grib_accessor_class* grib_accessor_class_gen; @@ -77,8 +93,8 @@ static grib_accessor_class _grib_accessor_class_data_apply_bitmap = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &GribAccessorDataApplyBitmap::unpack, /* grib_unpack procedures double */ - &GribAccessorDataApplyBitmap::unpack, /* grib_unpack procedures float */ + &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -363,6 +379,99 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return err; } +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; + + size_t i = 0; + size_t j = 0; + size_t n_vals = 0; + long nn = 0; + int err = 0; + size_t coded_n_vals = 0; + T* coded_vals = NULL; + double missing_value = 0; + + err = grib_value_count(a, &nn); + n_vals = nn; + if (err) + return err; + + if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) + return grib_get_array(grib_handle_of_accessor(a), self->coded_values, val, len); + + if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if (coded_n_vals == 0) { + for (i = 0; i < n_vals; i++) + val[i] = missing_value; + + *len = n_vals; + return GRIB_SUCCESS; + } + + if ((err = grib_get_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) + return err; + + coded_vals = (T*)grib_context_malloc(a->context, coded_n_vals * sizeof(T)); + if (coded_vals == NULL) + return GRIB_OUT_OF_MEMORY; + + if ((err = grib_get_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { + grib_context_free(a->context, coded_vals); + return err; + } + + grib_context_log(a->context, GRIB_LOG_DEBUG, + "grib_accessor_class_data_apply_bitmap: %s : creating %s, %d values", + __PRETTY_FUNCTION__, + a->name, n_vals); + + for (i = 0; i < n_vals; i++) { + if (val[i] == 0) { + val[i] = missing_value; + } + else { + val[i] = coded_vals[j++]; + if (j > coded_n_vals) { + grib_context_free(a->context, coded_vals); + grib_context_log(a->context, GRIB_LOG_ERROR, + "grib_accessor_class_data_apply_bitmap [%s]:" + " %s : number of coded values does not match bitmap %ld %ld", + a->name, __PRETTY_FUNCTION__, coded_n_vals, n_vals); + + return GRIB_ARRAY_TOO_SMALL; + } + } + } + + *len = n_vals; + + grib_context_free(a->context, coded_vals); + return err; +} + +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} + static int get_native_type(grib_accessor* a) { /* grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; diff --git a/src/grib_accessor_class_data_apply_bitmap.h b/src/grib_accessor_class_data_apply_bitmap.h deleted file mode 100644 index 2d95a05e8..000000000 --- a/src/grib_accessor_class_data_apply_bitmap.h +++ /dev/null @@ -1,109 +0,0 @@ -// ECC-1467 -#pragma once - -#include "grib_api_internal_cpp.h" -#include -#include - -typedef struct grib_accessor_data_apply_bitmap -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in data_apply_bitmap */ - const char* coded_values; - const char* bitmap; - const char* missing_value; - const char* number_of_data_points; - const char* number_of_values; - const char* binary_scale_factor; -} grib_accessor_data_apply_bitmap; - -template -class GribAccessorDataApplyBitmap { -public: - static int unpack(grib_accessor* a, T* val, size_t* len); -}; - -template -int GribAccessorDataApplyBitmap::unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a; - - size_t i = 0; - size_t j = 0; - size_t n_vals = 0; - long nn = 0; - int err = 0; - size_t coded_n_vals = 0; - T* coded_vals = NULL; - double missing_value = 0; - - err = grib_value_count(a, &nn); - n_vals = nn; - if (err) - return err; - - if (!grib_find_accessor(grib_handle_of_accessor(a), self->bitmap)) - return grib_get_array(grib_handle_of_accessor(a), self->coded_values, val, len); - - if ((err = grib_get_size(grib_handle_of_accessor(a), self->coded_values, &coded_n_vals)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_double_internal(grib_handle_of_accessor(a), self->missing_value, &missing_value)) != GRIB_SUCCESS) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if (coded_n_vals == 0) { - for (i = 0; i < n_vals; i++) - val[i] = missing_value; - - *len = n_vals; - return GRIB_SUCCESS; - } - - if ((err = grib_get_array_internal(grib_handle_of_accessor(a), self->bitmap, val, &n_vals)) != GRIB_SUCCESS) - return err; - - coded_vals = (T*)grib_context_malloc(a->context, coded_n_vals * sizeof(T)); - if (coded_vals == NULL) - return GRIB_OUT_OF_MEMORY; - - if ((err = grib_get_array(grib_handle_of_accessor(a), self->coded_values, coded_vals, &coded_n_vals)) != GRIB_SUCCESS) { - grib_context_free(a->context, coded_vals); - return err; - } - - grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_apply_bitmap: %s : creating %s, %d values", - __PRETTY_FUNCTION__, - a->name, n_vals); - - for (i = 0; i < n_vals; i++) { - if (val[i] == 0) { - val[i] = missing_value; - } - else { - val[i] = coded_vals[j++]; - if (j > coded_n_vals) { - grib_context_free(a->context, coded_vals); - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_apply_bitmap [%s]:" - " %s : number of coded values does not match bitmap %ld %ld", - a->name, __PRETTY_FUNCTION__, coded_n_vals, n_vals); - - return GRIB_ARRAY_TOO_SMALL; - } - } - } - - *len = n_vals; - - grib_context_free(a->context, coded_vals); - return err; -} - diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.cc b/src/grib_accessor_class_data_apply_boustrophedonic.cc index 470ef4cc2..cc5ef3a42 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/grib_accessor_class_data_apply_boustrophedonic.cc @@ -41,7 +41,9 @@ or edit "accessor.class" and rerun ./make_class.pl static int get_native_type(grib_accessor*); static int pack_double(grib_accessor*, const double* val, size_t* len); +template static int unpack(grib_accessor*, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); @@ -87,7 +89,7 @@ static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic = { &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ - 0, /* grib_unpack procedures float */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -180,14 +182,15 @@ static int value_count(grib_accessor* a, long* numberOfPoints) return ret; } -static int unpack_double(grib_accessor* a, double* val, size_t* len) +template +static int unpack(grib_accessor* a, T* val, size_t* len) { grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; size_t plSize = 0; long* pl = 0; double* values = 0; double* pvalues = 0; - double* pval = 0; + T* pval = 0; size_t valuesSize = 0; long i, j; int ret; @@ -274,6 +277,16 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) return GRIB_SUCCESS; } +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} + static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { size_t size; diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 17693d340..a8c2d090d 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -8,7 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_accessor_class_data_ccsds_packing.h" +#include "grib_api_internal_cpp.h" +#include /* This is used by make_class.pl @@ -49,12 +50,37 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); +template static int unpack(grib_accessor* a, T* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int unpack_double_element(grib_accessor*, size_t i, double* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); +typedef struct grib_accessor_data_ccsds_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_ccsds_packing */ + const char* number_of_values; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* bits_per_value; + const char* number_of_data_points; + const char* ccsds_flags; + const char* ccsds_block_size; + const char* ccsds_rsi; +} grib_accessor_data_ccsds_packing; + extern grib_accessor_class* grib_accessor_class_values; static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { @@ -80,8 +106,8 @@ static grib_accessor_class _grib_accessor_class_data_ccsds_packing = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &GribAccessorDataCcsdsPacking::unpack, /* grib_unpack procedures double */ - &GribAccessorDataCcsdsPacking::unpack, /* grib_unpack procedures float */ + &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -452,6 +478,128 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return err; } +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; + grib_handle* hand = grib_handle_of_accessor(a); + + int err = GRIB_SUCCESS, i = 0; + size_t buflen = 0; + struct aec_stream strm; + double bscale = 0; + double dscale = 0; + unsigned char* buf = NULL; + size_t n_vals = 0; + size_t size = 0; + unsigned char* decoded = NULL; + /*unsigned char* p = NULL;*/ + long pos = 0; + long nn = 0; + + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + double reference_value = 0; + long bits_per_value = 0; + long bits8; + + long ccsds_flags; + long ccsds_block_size; + long ccsds_rsi; + + self->dirty = 0; + + if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) + return err; + n_vals = nn; + + if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + + /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) + return err; + + /* TODO: This should be called upstream */ + if (*len < n_vals) + return GRIB_ARRAY_TOO_SMALL; + + /* Special case */ + if (bits_per_value == 0) { + for (i = 0; i < n_vals; i++) + val[i] = reference_value; + *len = n_vals; + return GRIB_SUCCESS; + } + + bscale = grib_power(binary_scale_factor, 2); + dscale = grib_power(-decimal_scale_factor, 10); + + buflen = grib_byte_count(a); + buf = (unsigned char*)hand->buffer->data; + buf += grib_byte_offset(a); + +strm.flags = ccsds_flags; +strm.bits_per_sample = bits_per_value; +strm.block_size = ccsds_block_size; +strm.rsi = ccsds_rsi; + +strm.next_in = buf; +strm.avail_in = buflen; + + bits8 = ((bits_per_value + 7) / 8) * 8; + size = n_vals * ((bits_per_value + 7) / 8); + decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); + if (!decoded) { + err = GRIB_OUT_OF_MEMORY; + goto cleanup; + } + strm.next_out = decoded; + strm.avail_out = size; + + if (hand->context->debug) print_aec_stream_info(&strm, "unpack_*"); + + if ((err = aec_buffer_decode(&strm)) != AEC_OK) { + grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS %s: aec_buffer_decode error %d (%s)\n", + __PRETTY_FUNCTION__, err, aec_get_error_message(err)); + err = GRIB_ENCODING_ERROR; + goto cleanup; +} + +pos = 0; + +/* ECC-1427: Performance improvement */ +//grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + *len = n_vals; + +cleanup: + grib_context_buffer_free(a->context, decoded); + return err; +} + +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} + static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { /* The index idx relates to codedValues NOT values! */ @@ -547,6 +695,16 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) print_error_feature_not_enabled(a->context); return GRIB_FUNCTIONALITY_NOT_ENABLED; } +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + print_error_feature_not_enabled(a->context); + return GRIB_FUNCTIONALITY_NOT_ENABLED; +} +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + print_error_feature_not_enabled(a->context); + return GRIB_FUNCTIONALITY_NOT_ENABLED; +} static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { print_error_feature_not_enabled(a->context); diff --git a/src/grib_accessor_class_data_ccsds_packing.h b/src/grib_accessor_class_data_ccsds_packing.h deleted file mode 100644 index 4edc152d3..000000000 --- a/src/grib_accessor_class_data_ccsds_packing.h +++ /dev/null @@ -1,163 +0,0 @@ -#pragma once - -#include "grib_api_internal_cpp.h" -#include - -#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) -#include -const char* aec_get_error_message(int code); -void print_aec_stream_info(struct aec_stream* strm, const char* func); -#endif - -void print_error_feature_not_enabled(grib_context* c); - -typedef struct grib_accessor_data_ccsds_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; - /* Members defined in data_ccsds_packing */ - const char* number_of_values; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* bits_per_value; - const char* number_of_data_points; - const char* ccsds_flags; - const char* ccsds_block_size; - const char* ccsds_rsi; -} grib_accessor_data_ccsds_packing; - - -template -class GribAccessorDataCcsdsPacking { -public: - static int unpack(grib_accessor* a, T* val, size_t* len); -}; - -#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) -template -int GribAccessorDataCcsdsPacking::unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; - grib_handle* hand = grib_handle_of_accessor(a); - - int err = GRIB_SUCCESS, i = 0; - size_t buflen = 0; - struct aec_stream strm; - double bscale = 0; - double dscale = 0; - unsigned char* buf = NULL; - size_t n_vals = 0; - size_t size = 0; - unsigned char* decoded = NULL; - /*unsigned char* p = NULL;*/ - long pos = 0; - long nn = 0; - - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - double reference_value = 0; - long bits_per_value = 0; - long bits8; - - long ccsds_flags; - long ccsds_block_size; - long ccsds_rsi; - - self->dirty = 0; - - if ((err = grib_value_count(a, &nn)) != GRIB_SUCCESS) - return err; - n_vals = nn; - - if ((err = grib_get_long_internal(hand, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - - /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(hand, self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) - return err; - - /* TODO: This should be called upstream */ - if (*len < n_vals) - return GRIB_ARRAY_TOO_SMALL; - - /* Special case */ - if (bits_per_value == 0) { - for (i = 0; i < n_vals; i++) - val[i] = reference_value; - *len = n_vals; - return GRIB_SUCCESS; - } - - bscale = grib_power(binary_scale_factor, 2); - dscale = grib_power(-decimal_scale_factor, 10); - - buflen = grib_byte_count(a); - buf = (unsigned char*)hand->buffer->data; - buf += grib_byte_offset(a); - -strm.flags = ccsds_flags; -strm.bits_per_sample = bits_per_value; -strm.block_size = ccsds_block_size; -strm.rsi = ccsds_rsi; - -strm.next_in = buf; -strm.avail_in = buflen; - - bits8 = ((bits_per_value + 7) / 8) * 8; - size = n_vals * ((bits_per_value + 7) / 8); - decoded = (unsigned char*)grib_context_buffer_malloc_clear(a->context, size); - if (!decoded) { - err = GRIB_OUT_OF_MEMORY; - goto cleanup; - } - strm.next_out = decoded; - strm.avail_out = size; - - if (hand->context->debug) print_aec_stream_info(&strm, "unpack_*"); - - if ((err = aec_buffer_decode(&strm)) != AEC_OK) { - grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS %s: aec_buffer_decode error %d (%s)\n", - __PRETTY_FUNCTION__, err, aec_get_error_message(err)); - err = GRIB_ENCODING_ERROR; - goto cleanup; -} - -pos = 0; - -/* ECC-1427: Performance improvement */ -//grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); - *len = n_vals; - -cleanup: - grib_context_buffer_free(a->context, decoded); - return err; -} - -#else -template -int GribAccessorDataCcsdsPacking::unpack(grib_accessor* a, T* val, size_t* len) -{ - print_error_feature_not_enabled(a->context); - return GRIB_FUNCTIONALITY_NOT_ENABLED; -} -#endif diff --git a/src/grib_accessor_class_data_complex_packing.cc b/src/grib_accessor_class_data_complex_packing.cc index 0631b3b80..e10249fed 100644 --- a/src/grib_accessor_class_data_complex_packing.cc +++ b/src/grib_accessor_class_data_complex_packing.cc @@ -8,8 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_accessor_class_data_complex_packing.h" -#include "grib_optimize_decimal_factor.h" +#include "grib_api_internal_cpp.h" +#include #include /* This is used by make_class.pl @@ -48,10 +48,49 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); +template static int unpack(grib_accessor* a, T* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); +typedef unsigned long (*encode_float_proc)(double); +typedef double (*decode_float_proc)(unsigned long); + +typedef struct grib_accessor_data_complex_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_simple_packing */ + int edition; + const char* units_factor; + const char* units_bias; + const char* changing_precision; + const char* number_of_values; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* optimize_scaling_factor; + /* Members defined in data_complex_packing */ + const char* GRIBEX_sh_bug_present; + const char* ieee_floats; + const char* laplacianOperatorIsSet; + const char* laplacianOperator; + const char* sub_j; + const char* sub_k; + const char* sub_m; + const char* pen_j; + const char* pen_k; + const char* pen_m; +} grib_accessor_data_complex_packing; extern grib_accessor_class* grib_accessor_class_data_simple_packing; @@ -78,8 +117,8 @@ static grib_accessor_class _grib_accessor_class_data_complex_packing = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &GribAccessorClassDataComplexPacking::unpack, /* grib_unpack procedures double */ - &GribAccessorClassDataComplexPacking::unpack, /* grib_unpack procedures float */ + &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -669,3 +708,234 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return ret; } + + +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0; + long lcount = 0; + long hpos = 0; + long lup = 0; + long mmax = 0; + long n_vals = 0; + T* scals = NULL; + T* pscals = NULL, *pval = NULL; + + double s = 0; + double d = 0; + double laplacianOperator = 0; + unsigned char* buf = NULL; + unsigned char* hres = NULL; + unsigned char* lres = NULL; + unsigned long packed_offset; + long lpos = 0; + + long maxv = 0; + long GRIBEX_sh_bug_present = 0; + long ieee_floats = 0; + + long offsetdata = 0; + long bits_per_value = 0; + double reference_value = 0; + long binary_scale_factor = 0; + long decimal_scale_factor = 0; + + long sub_j = 0; + long sub_k = 0; + long sub_m = 0; + long pen_j = 0; + long pen_k = 0; + long pen_m = 0; + + T operat = 0; + int bytes; + int err = 0; + + decode_float_proc decode_float = NULL; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if (*len < n_vals) { + *len = n_vals; + return GRIB_ARRAY_TOO_SMALL; + } + + if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) + return ret; + + /* ECC-774: don't use grib_get_long_internal */ + if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) + return ret; + + if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) + return ret; + if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) + return ret; + + self->dirty = 0; + + switch (ieee_floats) { + case 0: + decode_float = grib_long_to_ibm; + bytes = 4; + break; + case 1: + decode_float = grib_long_to_ieee; + bytes = 4; + break; + case 2: + decode_float = grib_long_to_ieee64; + bytes = 8; + break; + default: + return GRIB_NOT_IMPLEMENTED; + } + + Assert(sub_j == sub_k); + Assert(sub_j == sub_m); + Assert(pen_j == pen_k); + Assert(pen_j == pen_m); + + buf = (unsigned char*)gh->buffer->data; + + maxv = pen_j + 1; + + buf += grib_byte_offset(a); + hres = buf; + lres = buf; + + if (pen_j == sub_j) { + n_vals = (pen_j + 1) * (pen_j + 2); + d = grib_power(-decimal_scale_factor, 10); + + grib_ieee_decode_array(a->context, buf, n_vals, bytes, val); + if (d) { + for (i = 0; i < n_vals; i++) + val[i] *= d; + } + return 0; + } + + + packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); + + lpos = 8 * (packed_offset - offsetdata); + + s = grib_power(binary_scale_factor, 2); + d = grib_power(-decimal_scale_factor, 10); + + scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); + Assert(scals); + + scals[0] = 0; + for (i = 1; i < maxv; i++) { + operat = pow(i * (i + 1), laplacianOperator); + if (operat != 0) + scals[i] = (1.0 / operat); + else { + grib_context_log(a->context, GRIB_LOG_WARNING, + "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", + i, maxv); + scals[i] = 0; + } + } + + /* + printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); + printf("packed offset=%ld\n",packed_offset); + for(i=0;i 0) { + lup = mmax; + if (sub_k >= 0) { + for (hcount = 0; hcount < sub_k + 1; hcount++) { + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); + + if (GRIBEX_sh_bug_present && hcount == sub_k) { + /* bug in ecmwf data, last row (K+1)is scaled but should not */ + val[i - 2] *= scals[lup]; + val[i - 1] *= scals[lup]; + } + lup++; + } + sub_k--; + } + + pscals = scals + lup; + pval = val + i; +#if FAST_BIG_ENDIAN + grib_decode_double_array_complex(lres, + &lpos, bits_per_value, + reference_value, s, pscals, (maxv - hcount) * 2, pval); + i += (maxv - hcount) * 2; +#else + (void)pscals; /* suppress gcc warning */ + (void)pval; /* suppress gcc warning */ + for (lcount = hcount; lcount < maxv; lcount++) { + val[i++] = d * (T)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + val[i++] = d * (T)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; + /* These values should always be zero, but as they are packed, + it is necessary to force them back to zero */ + if (mmax == 0) + val[i - 1] = 0; + lup++; + } +#endif + + maxv--; + hcount = 0; + mmax++; + } + + Assert(*len >= i); + *len = i; + + grib_context_free(a->context, scals); + + return ret; +} + +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} diff --git a/src/grib_accessor_class_data_complex_packing.h b/src/grib_accessor_class_data_complex_packing.h deleted file mode 100644 index c490f8218..000000000 --- a/src/grib_accessor_class_data_complex_packing.h +++ /dev/null @@ -1,268 +0,0 @@ -#pragma once - -#include "grib_api_internal_cpp.h" -#include - -typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); - -typedef struct grib_accessor_data_complex_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; - /* Members defined in data_simple_packing */ - int edition; - const char* units_factor; - const char* units_bias; - const char* changing_precision; - const char* number_of_values; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* optimize_scaling_factor; - /* Members defined in data_complex_packing */ - const char* GRIBEX_sh_bug_present; - const char* ieee_floats; - const char* laplacianOperatorIsSet; - const char* laplacianOperator; - const char* sub_j; - const char* sub_k; - const char* sub_m; - const char* pen_j; - const char* pen_k; - const char* pen_m; -} grib_accessor_data_complex_packing; - - -template -class GribAccessorClassDataComplexPacking { -public: - static int unpack(grib_accessor* a, T* val, size_t* len); -}; - -// ECC-1467: FloatDataValues -template -int GribAccessorClassDataComplexPacking::unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating point numbers"); - grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; - grib_handle* gh = grib_handle_of_accessor(a); - - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; - T* scals = NULL; - T*pscals = NULL, *pval = NULL; - - double s = 0; - double d = 0; - double laplacianOperator = 0; - unsigned char* buf = NULL; - unsigned char* hres = NULL; - unsigned char* lres = NULL; - unsigned long packed_offset; - long lpos = 0; - - long maxv = 0; - long GRIBEX_sh_bug_present = 0; - long ieee_floats = 0; - - long offsetdata = 0; - long bits_per_value = 0; - double reference_value = 0; - long binary_scale_factor = 0; - long decimal_scale_factor = 0; - - long sub_j = 0; - long sub_k = 0; - long sub_m = 0; - long pen_j = 0; - long pen_k = 0; - long pen_m = 0; - - T operat = 0; - int bytes; - int err = 0; - - decode_float_proc decode_float = NULL; - - err = grib_value_count(a, &n_vals); - if (err) - return err; - - if (*len < n_vals) { - *len = n_vals; - return GRIB_ARRAY_TOO_SMALL; - } - - if ((ret = grib_get_long_internal(gh, self->offsetdata, &offsetdata)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_long_internal(gh, self->GRIBEX_sh_bug_present, &GRIBEX_sh_bug_present)) != GRIB_SUCCESS) - return ret; - - /* ECC-774: don't use grib_get_long_internal */ - if ((ret = grib_get_long(gh, self->ieee_floats, &ieee_floats)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_double_internal(gh, self->laplacianOperator, &laplacianOperator)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_j, &sub_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_k, &sub_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->sub_m, &sub_m)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_j, &pen_j)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_k, &pen_k)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_long_internal(gh, self->pen_m, &pen_m)) != GRIB_SUCCESS) - return ret; - - self->dirty = 0; - - switch (ieee_floats) { - case 0: - decode_float = grib_long_to_ibm; - bytes = 4; - break; - case 1: - decode_float = grib_long_to_ieee; - bytes = 4; - break; - case 2: - decode_float = grib_long_to_ieee64; - bytes = 8; - break; - default: - return GRIB_NOT_IMPLEMENTED; - } - - Assert(sub_j == sub_k); - Assert(sub_j == sub_m); - Assert(pen_j == pen_k); - Assert(pen_j == pen_m); - - buf = (unsigned char*)gh->buffer->data; - - maxv = pen_j + 1; - - buf += grib_byte_offset(a); - hres = buf; - lres = buf; - - if (pen_j == sub_j) { - n_vals = (pen_j + 1) * (pen_j + 2); - d = grib_power(-decimal_scale_factor, 10); - grib_ieee_decode_array(a->context, buf, n_vals, bytes, val); - if (d) { - for (i = 0; i < n_vals; i++) - val[i] *= d; - } - return 0; - } - - - packed_offset = grib_byte_offset(a) + bytes * (sub_k + 1) * (sub_k + 2); - - lpos = 8 * (packed_offset - offsetdata); - - s = grib_power(binary_scale_factor, 2); - d = grib_power(-decimal_scale_factor, 10); - - scals = (T*)grib_context_malloc(a->context, maxv * sizeof(T)); - Assert(scals); - - scals[0] = 0; - for (i = 1; i < maxv; i++) { - operat = pow(i * (i + 1), laplacianOperator); - if (operat != 0) - scals[i] = (1.0 / operat); - else { - grib_context_log(a->context, GRIB_LOG_WARNING, - "COMPLEX_PACKING : problem with operator div by zero at index %d of %d \n", - i, maxv); - scals[i] = 0; - } - } - - /* - printf("UNPACKING LAPLACE=%.20f\n",laplacianOperator); - printf("packed offset=%ld\n",packed_offset); - for(i=0;i 0) { - lup = mmax; - if (sub_k >= 0) { - for (hcount = 0; hcount < sub_k + 1; hcount++) { - val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - val[i++] = decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes)); - - if (GRIBEX_sh_bug_present && hcount == sub_k) { - /* bug in ecmwf data, last row (K+1)is scaled but should not */ - val[i - 2] *= scals[lup]; - val[i - 1] *= scals[lup]; - } - lup++; - } - sub_k--; - } - - pscals = scals + lup; - pval = val + i; -#if FAST_BIG_ENDIAN - grib_decode_double_array_complex(lres, - &lpos, bits_per_value, - reference_value, s, pscals, (maxv - hcount) * 2, pval); - i += (maxv - hcount) * 2; -#else - (void)pscals; /* suppress gcc warning */ - (void)pval; /* suppress gcc warning */ - for (lcount = hcount; lcount < maxv; lcount++) { - val[i++] = d * (T)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; - val[i++] = d * (T)((grib_decode_unsigned_long(lres, &lpos, bits_per_value) * s) + reference_value) * scals[lup]; - /* These values should always be zero, but as they are packed, - it is necessary to force them back to zero */ - if (mmax == 0) - val[i - 1] = 0; - lup++; - } -#endif - - maxv--; - hcount = 0; - mmax++; - } - - Assert(*len >= i); - *len = i; - - grib_context_free(a->context, scals); - - return ret; -} diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index a4dbd89ff..db54646ee 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -9,7 +9,8 @@ */ -#include "grib_accessor_class_data_g22order_packing.h" +#include "grib_api_internal.h" +#include /* This is used by make_class.pl @@ -57,12 +58,46 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); +template static int unpack(grib_accessor* a, T* val, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); static int unpack_double_element(grib_accessor*, size_t i, double* val); static int unpack_double_element_set(grib_accessor*, const size_t* index_array, size_t len, double* val_array); +typedef struct grib_accessor_data_g22order_packing +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in values */ + int carg; + const char* seclen; + const char* offsetdata; + const char* offsetsection; + int dirty; + /* Members defined in data_g22order_packing */ + const char* numberOfValues; + const char* bits_per_value; + const char* reference_value; + const char* binary_scale_factor; + const char* decimal_scale_factor; + const char* typeOfOriginalFieldValues; + const char* groupSplittingMethodUsed; + const char* missingValueManagementUsed; + const char* primaryMissingValueSubstitute; + const char* secondaryMissingValueSubstitute; + const char* numberOfGroupsOfDataValues; + const char* referenceForGroupWidths; + const char* numberOfBitsUsedForTheGroupWidths; + const char* referenceForGroupLengths; + const char* lengthIncrementForTheGroupLengths; + const char* trueLengthOfLastGroup; + const char* numberOfBitsUsedForTheScaledGroupLengths; + const char* orderOfSpatialDifferencing; + const char* numberOfOctetsExtraDescriptors; +} grib_accessor_data_g22order_packing; extern grib_accessor_class* grib_accessor_class_values; @@ -89,8 +124,8 @@ static grib_accessor_class _grib_accessor_class_data_g22order_packing = { 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &GribAccessorDataG22orderPacking::unpack, /* grib_unpack procedures double */ - &GribAccessorDataG22orderPacking::unpack, /* grib_unpack procedures float */ + &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -674,6 +709,267 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_SUCCESS; } + +template +static int unpack(grib_accessor* a, T* val, size_t* len) +{ + static_assert(std::is_floating_point::value, "Requires floating points numbers"); + grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; + + size_t i = 0; + size_t j = 0; + long n_vals = 0; + long vcount = 0; + int err = GRIB_SUCCESS; + + long* sec_val = NULL; + grib_handle* gh = grib_handle_of_accessor(a); + + unsigned char* buf = (unsigned char*)gh->buffer->data; + unsigned char* buf_ref = NULL; + unsigned char* buf_width = NULL; + unsigned char* buf_length = NULL; + unsigned char* buf_vals = NULL; + + long length_p = 0; + long ref_p = 0; + long width_p = 0; + long vals_p = 0; + + long nvals_per_group = 0; + long nbits_per_group_val = 0; + long group_ref_val = 0; + + long bits_per_value = 0; + T binary_s = 0; + T decimal_s = 0; + double reference_value = 0; + + long binary_scale_factor; + long decimal_scale_factor; + long typeOfOriginalFieldValues; + long groupSplittingMethodUsed; + long missingValueManagementUsed; + long primaryMissingValueSubstitute; + long secondaryMissingValueSubstitute; + long numberOfGroupsOfDataValues; + long referenceForGroupWidths; + long numberOfBitsUsedForTheGroupWidths; + long referenceForGroupLengths; + long lengthIncrementForTheGroupLengths; + long trueLengthOfLastGroup; + long numberOfBitsUsedForTheScaledGroupLengths; + long orderOfSpatialDifferencing; + long numberOfOctetsExtraDescriptors; + double missingValue = 0; + + err = grib_value_count(a, &n_vals); + if (err) + return err; + + if (*len < (size_t)n_vals) + return GRIB_ARRAY_TOO_SMALL; + + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) + return err; + + /* Don't call grib_get_long_internal to suppress error message being output */ + if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) + return err; + + self->dirty = 0; + + sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); + if (!sec_val) + return GRIB_OUT_OF_MEMORY; + memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ + + buf_ref = buf + a->offset; + + ref_p = (numberOfGroupsOfDataValues * bits_per_value); + + if (orderOfSpatialDifferencing) + ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); + + buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); + + width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); + buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); + + length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); + buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); + + length_p = 0; + ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; + width_p = 0; + vals_p = 0; + vcount = 0; + + for (i = 0; i < numberOfGroupsOfDataValues; i++) { + group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); + nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); + nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); + + nvals_per_group *= lengthIncrementForTheGroupLengths; + nvals_per_group += referenceForGroupLengths; + nbits_per_group_val += referenceForGroupWidths; + + if (i == numberOfGroupsOfDataValues - 1) + nvals_per_group = trueLengthOfLastGroup; + Assert(n_vals >= vcount + nvals_per_group); + + /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, + &sec_val[vcount]); */ + if (missingValueManagementUsed == 0) { + /* No explicit missing values included within data values */ + for (j = 0; j < nvals_per_group; j++) { + DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); + sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ + } + } + else if (missingValueManagementUsed == 1) { + /* Primary missing values included within data values */ + long maxn = 0; /* (1 << bits_per_value) - 1; */ + for (j = 0; j < nvals_per_group; j++) { + if (nbits_per_group_val == 0) { + maxn = (1 << bits_per_value) - 1; + if (group_ref_val == maxn) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; + } + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + if (temp == maxn) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; + } + } + } + } + else if (missingValueManagementUsed == 2) { + /* Primary and secondary missing values included within data values */ + long maxn = (1 << bits_per_value) - 1; + long maxn2 = 0; /* maxn - 1; */ + for (j = 0; j < nvals_per_group; j++) { + if (nbits_per_group_val == 0) { + maxn2 = maxn - 1; + if (group_ref_val == maxn || group_ref_val == maxn2) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + sec_val[vcount + j] = group_ref_val + temp; + } + } + else { + long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); + maxn = (1 << nbits_per_group_val) - 1; + maxn2 = maxn - 1; + if (temp == maxn || temp == maxn2) { + sec_val[vcount + j] = LONG_MAX; /* missing value */ + } + else { + sec_val[vcount + j] = group_ref_val + temp; + } + } + } + } + + vcount += nvals_per_group; + } + + if (orderOfSpatialDifferencing) { + long bias = 0; + unsigned long extras[2] = {0,}; + ref_p = 0; + + /* For Complex packing, order == 0 */ + /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ + if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); + return GRIB_INTERNAL_ERROR; + } + + for (i = 0; i < orderOfSpatialDifferencing; i++) { + extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); + } + + bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); + + post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); + /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ + } + + binary_s = grib_power(binary_scale_factor, 2); + decimal_s = grib_power(-decimal_scale_factor, 10); + + for (i = 0; i < n_vals; i++) { + if (sec_val[i] == LONG_MAX) { + val[i] = missingValue; + } + else { + val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; + } + } + + grib_context_free(a->context, sec_val); + return err; +} + +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} + static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { size_t size = 0; diff --git a/src/grib_accessor_class_data_g22order_packing.h b/src/grib_accessor_class_data_g22order_packing.h deleted file mode 100644 index 70ac1a63a..000000000 --- a/src/grib_accessor_class_data_g22order_packing.h +++ /dev/null @@ -1,295 +0,0 @@ -#pragma once - -#include "grib_api_internal.h" -#include - -typedef struct grib_accessor_data_g22order_packing -{ - grib_accessor att; - /* Members defined in gen */ - /* Members defined in values */ - int carg; - const char* seclen; - const char* offsetdata; - const char* offsetsection; - int dirty; - /* Members defined in data_g22order_packing */ - const char* numberOfValues; - const char* bits_per_value; - const char* reference_value; - const char* binary_scale_factor; - const char* decimal_scale_factor; - const char* typeOfOriginalFieldValues; - const char* groupSplittingMethodUsed; - const char* missingValueManagementUsed; - const char* primaryMissingValueSubstitute; - const char* secondaryMissingValueSubstitute; - const char* numberOfGroupsOfDataValues; - const char* referenceForGroupWidths; - const char* numberOfBitsUsedForTheGroupWidths; - const char* referenceForGroupLengths; - const char* lengthIncrementForTheGroupLengths; - const char* trueLengthOfLastGroup; - const char* numberOfBitsUsedForTheScaledGroupLengths; - const char* orderOfSpatialDifferencing; - const char* numberOfOctetsExtraDescriptors; -} grib_accessor_data_g22order_packing; - -int post_process(grib_context* c, long* vals, long len, long order, long bias, const unsigned long extras[2]); - -template -class GribAccessorDataG22orderPacking { -public: - static int unpack(grib_accessor* a, T* val, size_t* len); -}; - -template -int GribAccessorDataG22orderPacking::unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating points numbers"); - grib_accessor_data_g22order_packing* self = (grib_accessor_data_g22order_packing*)a; - - size_t i = 0; - size_t j = 0; - long n_vals = 0; - long vcount = 0; - int err = GRIB_SUCCESS; - - long* sec_val = NULL; - grib_handle* gh = grib_handle_of_accessor(a); - - unsigned char* buf = (unsigned char*)gh->buffer->data; - unsigned char* buf_ref = NULL; - unsigned char* buf_width = NULL; - unsigned char* buf_length = NULL; - unsigned char* buf_vals = NULL; - - long length_p = 0; - long ref_p = 0; - long width_p = 0; - long vals_p = 0; - - long nvals_per_group = 0; - long nbits_per_group_val = 0; - long group_ref_val = 0; - - long bits_per_value = 0; - T binary_s = 0; - T decimal_s = 0; - double reference_value = 0; - - long binary_scale_factor; - long decimal_scale_factor; - long typeOfOriginalFieldValues; - long groupSplittingMethodUsed; - long missingValueManagementUsed; - long primaryMissingValueSubstitute; - long secondaryMissingValueSubstitute; - long numberOfGroupsOfDataValues; - long referenceForGroupWidths; - long numberOfBitsUsedForTheGroupWidths; - long referenceForGroupLengths; - long lengthIncrementForTheGroupLengths; - long trueLengthOfLastGroup; - long numberOfBitsUsedForTheScaledGroupLengths; - long orderOfSpatialDifferencing; - long numberOfOctetsExtraDescriptors; - double missingValue = 0; - - err = grib_value_count(a, &n_vals); - if (err) - return err; - - if (*len < (size_t)n_vals) - return GRIB_ARRAY_TOO_SMALL; - - if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(gh, self->reference_value, &reference_value)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->binary_scale_factor, &binary_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) - return err; - - /* Don't call grib_get_long_internal to suppress error message being output */ - if ((err = grib_get_long(gh, self->groupSplittingMethodUsed, &groupSplittingMethodUsed)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->primaryMissingValueSubstitute, &primaryMissingValueSubstitute)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->secondaryMissingValueSubstitute, &secondaryMissingValueSubstitute)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfGroupsOfDataValues, &numberOfGroupsOfDataValues)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->referenceForGroupWidths, &referenceForGroupWidths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheGroupWidths, &numberOfBitsUsedForTheGroupWidths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->referenceForGroupLengths, &referenceForGroupLengths)) != GRIB_SUCCESS) - return err; - - if ((err = grib_get_long_internal(gh, self->lengthIncrementForTheGroupLengths, &lengthIncrementForTheGroupLengths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->trueLengthOfLastGroup, &trueLengthOfLastGroup)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfBitsUsedForTheScaledGroupLengths, &numberOfBitsUsedForTheScaledGroupLengths)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->orderOfSpatialDifferencing, &orderOfSpatialDifferencing)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_long_internal(gh, self->numberOfOctetsExtraDescriptors, &numberOfOctetsExtraDescriptors)) != GRIB_SUCCESS) - return err; - if ((err = grib_get_double_internal(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) - return err; - - self->dirty = 0; - - sec_val = (long*)grib_context_malloc(a->context, (n_vals) * sizeof(long)); - if (!sec_val) - return GRIB_OUT_OF_MEMORY; - memset(sec_val, 0, (n_vals) * sizeof(long)); /* See SUP-718 */ - - buf_ref = buf + a->offset; - - ref_p = (numberOfGroupsOfDataValues * bits_per_value); - - if (orderOfSpatialDifferencing) - ref_p += (1 + orderOfSpatialDifferencing) * (numberOfOctetsExtraDescriptors * 8); - - buf_width = buf_ref + (ref_p / 8) + ((ref_p % 8) ? 1 : 0); - - width_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheGroupWidths); - buf_length = buf_width + (width_p / 8) + ((width_p % 8) ? 1 : 0); - - length_p = (numberOfGroupsOfDataValues * numberOfBitsUsedForTheScaledGroupLengths); - buf_vals = buf_length + (length_p / 8) + ((length_p % 8) ? 1 : 0); - - length_p = 0; - ref_p = orderOfSpatialDifferencing ? (orderOfSpatialDifferencing + 1) * (numberOfOctetsExtraDescriptors * 8) : 0; - width_p = 0; - vals_p = 0; - vcount = 0; - - for (i = 0; i < numberOfGroupsOfDataValues; i++) { - group_ref_val = grib_decode_unsigned_long(buf_ref, &ref_p, bits_per_value); - nvals_per_group = grib_decode_unsigned_long(buf_length, &length_p, numberOfBitsUsedForTheScaledGroupLengths); - nbits_per_group_val = grib_decode_unsigned_long(buf_width, &width_p, numberOfBitsUsedForTheGroupWidths); - - nvals_per_group *= lengthIncrementForTheGroupLengths; - nvals_per_group += referenceForGroupLengths; - nbits_per_group_val += referenceForGroupWidths; - - if (i == numberOfGroupsOfDataValues - 1) - nvals_per_group = trueLengthOfLastGroup; - Assert(n_vals >= vcount + nvals_per_group); - - /*grib_decode_long_array(buf_vals, &vals_p, nbits_per_group_val, nvals_per_group, - &sec_val[vcount]); */ - if (missingValueManagementUsed == 0) { - /* No explicit missing values included within data values */ - for (j = 0; j < nvals_per_group; j++) { - DebugAssertAccess(sec_val, (long)(vcount + j), n_vals); - sec_val[vcount + j] = group_ref_val + grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - /*printf("sec_val[%ld]=%ld\n", vcount+j, sec_val[vcount+j]);*/ - } - } - else if (missingValueManagementUsed == 1) { - /* Primary missing values included within data values */ - long maxn = 0; /* (1 << bits_per_value) - 1; */ - for (j = 0; j < nvals_per_group; j++) { - if (nbits_per_group_val == 0) { - maxn = (1 << bits_per_value) - 1; - if (group_ref_val == maxn) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount + j] = group_ref_val + temp; - } - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - if (temp == maxn) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - sec_val[vcount + j] = group_ref_val + temp; - } - } - } - } - else if (missingValueManagementUsed == 2) { - /* Primary and secondary missing values included within data values */ - long maxn = (1 << bits_per_value) - 1; - long maxn2 = 0; /* maxn - 1; */ - for (j = 0; j < nvals_per_group; j++) { - if (nbits_per_group_val == 0) { - maxn2 = maxn - 1; - if (group_ref_val == maxn || group_ref_val == maxn2) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - sec_val[vcount + j] = group_ref_val + temp; - } - } - else { - long temp = grib_decode_unsigned_long(buf_vals, &vals_p, nbits_per_group_val); - maxn = (1 << nbits_per_group_val) - 1; - maxn2 = maxn - 1; - if (temp == maxn || temp == maxn2) { - sec_val[vcount + j] = LONG_MAX; /* missing value */ - } - else { - sec_val[vcount + j] = group_ref_val + temp; - } - } - } - } - - vcount += nvals_per_group; - } - - if (orderOfSpatialDifferencing) { - long bias = 0; - unsigned long extras[2] = {0,}; - ref_p = 0; - - /* For Complex packing, order == 0 */ - /* For Complex packing and spatial differencing, order == 1 or 2 (code table 5.6) */ - if (orderOfSpatialDifferencing != 1 && orderOfSpatialDifferencing != 2) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Unsupported order of spatial differencing %ld", orderOfSpatialDifferencing); - return GRIB_INTERNAL_ERROR; - } - - for (i = 0; i < orderOfSpatialDifferencing; i++) { - extras[i] = grib_decode_unsigned_long(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); - } - - bias = grib_decode_signed_longb(buf_ref, &ref_p, numberOfOctetsExtraDescriptors * 8); - - post_process(a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias, extras); - /*de_spatial_difference (a->context, sec_val, n_vals, orderOfSpatialDifferencing, bias);*/ - } - - binary_s = grib_power(binary_scale_factor, 2); - decimal_s = grib_power(-decimal_scale_factor, 10); - - for (i = 0; i < n_vals; i++) { - if (sec_val[i] == LONG_MAX) { - val[i] = missingValue; - } - else { - val[i] = (double)((((double)sec_val[i]) * binary_s) + reference_value) * decimal_s; - } - } - - grib_context_free(a->context, sec_val); - return err; -} - diff --git a/src/grib_accessor_class_data_raw_packing.cc b/src/grib_accessor_class_data_raw_packing.cc index acceae597..a574e7fcb 100644 --- a/src/grib_accessor_class_data_raw_packing.cc +++ b/src/grib_accessor_class_data_raw_packing.cc @@ -11,6 +11,7 @@ * Enrico Fucile ****************************/ +#include "grib_api_internal.h" #include "grib_api_internal_cpp.h" #define PRE_PROCESSING_NONE 0 diff --git a/src/grib_accessor_class_data_simple_packing.cc b/src/grib_accessor_class_data_simple_packing.cc index fd647e252..79d855561 100644 --- a/src/grib_accessor_class_data_simple_packing.cc +++ b/src/grib_accessor_class_data_simple_packing.cc @@ -53,6 +53,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); +template static int unpack(grib_accessor* a, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); @@ -321,16 +322,20 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } -// unpack an array of double-precision (double) or single-precision (float) real numbers. -// As doubles if dval!=NULL -// As floats if fval!=NULL -static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len, unsigned char* buf, long pos, size_t n_vals) +template +static int unpack(grib_accessor* a, T* val, size_t* len) { + static_assert(std::is_floating_point::value, "Requires floating point numbers"); + grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; grib_handle* gh = grib_handle_of_accessor(a); + unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - size_t i = 0; - int err = 0; + size_t i = 0; + int err = 0; + size_t n_vals = 0; + long pos = 0; + long count = 0; double reference_value; long binary_scale_factor; @@ -342,8 +347,10 @@ static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len double units_factor = 1.0; double units_bias = 0.0; - // Either decode as double or float: cannot have both! - Assert( ! (fval && dval) ); + err = grib_value_count(a, &count); + if (err) + return err; + n_vals = count; if (*len < n_vals) { *len = (long)n_vals; @@ -390,13 +397,8 @@ static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len /* Special case */ if (bits_per_value == 0) { - if (dval) { - for (i = 0; i < n_vals; i++) - dval[i] = reference_value; - } else if (fval) { - for (i = 0; i < n_vals; i++) - fval[i] = reference_value; - } + for (i = 0; i < n_vals; i++) + val[i] = reference_value; *len = n_vals; return GRIB_SUCCESS; } @@ -441,42 +443,34 @@ static int _unpack_real(grib_accessor* a, double* dval, float* fval, size_t* len grib_context_log(a->context, GRIB_LOG_DEBUG, "unpack_double: calling outline function : bpv %d, rv : %g, sf : %d, dsf : %d ", bits_per_value, reference_value, binary_scale_factor, decimal_scale_factor); - if(dval) - grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, dval); - if(fval) - grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, fval); + grib_decode_array(buf, &pos, bits_per_value, reference_value, s, d, n_vals, val); *len = (long)n_vals; - if(dval) { - if (units_factor != 1.0) { - if (units_bias != 0.0) - for (i = 0; i < n_vals; i++) - dval[i] = dval[i] * units_factor + units_bias; - else - for (i = 0; i < n_vals; i++) - dval[i] *= units_factor; - } - else if (units_bias != 0.0) + if (units_factor != 1.0) { + if (units_bias != 0.0) for (i = 0; i < n_vals; i++) - dval[i] += units_bias; - } - if(fval) { - if (units_factor != 1.0) { - if (units_bias != 0.0) - for (i = 0; i < n_vals; i++) - fval[i] = fval[i] * units_factor + units_bias; - else - for (i = 0; i < n_vals; i++) - fval[i] *= units_factor; - } - else if (units_bias != 0.0) + val[i] = val[i] * units_factor + units_bias; + else for (i = 0; i < n_vals; i++) - fval[i] += units_bias; + val[i] *= units_factor; } + else if (units_bias != 0.0) + for (i = 0; i < n_vals; i++) + val[i] += units_bias; return err; } +static int unpack_double(grib_accessor* a, double* val, size_t* len) +{ + return unpack(a, val, len); +} + +static int unpack_float(grib_accessor* a, float* val, size_t* len) +{ + return unpack(a, val, len); +} + static int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned char* buf, long pos, size_t n_vals) { grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a; @@ -624,38 +618,6 @@ static int unpack_double_subarray(grib_accessor* a, double* val, size_t start, s return _unpack_double(a, val, plen, buf, pos, nvals); } -static int unpack_double(grib_accessor* a, double* dval, size_t* len) -{ - unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - size_t nvals = 0; - long pos = 0; - int err = 0; - long count = 0; - - err = grib_value_count(a, &count); - if (err) - return err; - nvals = count; - - return _unpack_real(a, dval, NULL, len, buf, pos, nvals); -} - -static int unpack_float(grib_accessor* a, float* fval, size_t* len) -{ - unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; - size_t nvals = 0; - long pos = 0; - int err = 0; - long count = 0; - - err = grib_value_count(a, &count); - if (err) - return err; - nvals = count; - - return _unpack_real(a, NULL, fval, len, buf, pos, nvals); -} - #if GRIB_IBMPOWER67_OPT #define restrict #include "minmax_val.cc" diff --git a/src/grib_accessor_class_gen.cc b/src/grib_accessor_class_gen.cc index 6cd7d898b..d7b36cf0c 100644 --- a/src/grib_accessor_class_gen.cc +++ b/src/grib_accessor_class_gen.cc @@ -13,7 +13,11 @@ * Enrico Fucile * * Shahram Najm * ***************************************************************************/ -#include "grib_accessor_class_gen.h" +#include "grib_api_internal.h" +#include +#include +#include + /* This is used by make_class.pl @@ -56,6 +60,10 @@ static int pack_string(grib_accessor*, const char*, size_t* len); static int pack_string_array(grib_accessor*, const char**, size_t* len); static int pack_expression(grib_accessor*, grib_expression*); static int unpack_bytes(grib_accessor*, unsigned char*, size_t* len); +static int unpack_double(grib_accessor*, double* val, size_t* len); +static int unpack_float(grib_accessor*, float* val, size_t* len); +static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static int unpack_string_array(grib_accessor*, char**, size_t* len); static size_t string_length(grib_accessor*); static long byte_count(grib_accessor*); @@ -104,13 +112,13 @@ static grib_accessor_class _grib_accessor_class_gen = { 0, /* grib_pack procedures long */ &is_missing, /* grib_pack procedures long */ &pack_long, /* grib_pack procedures long */ - &GribAccessorClassGen::unpack, /* grib_unpack procedures long */ + &unpack_long, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ 0, /* grib_pack procedures float */ - &GribAccessorClassGen::unpack, /* grib_unpack procedures double */ - &GribAccessorClassGen::unpack, /* grib_unpack procedures float */ + &unpack_double, /* grib_unpack procedures double */ + &unpack_float, /* grib_unpack procedures float */ &pack_string, /* grib_pack procedures string */ - &GribAccessorClassGen::unpack, /* grib_unpack procedures string */ + &unpack_string, /* grib_unpack procedures string */ &pack_string_array, /* grib_pack array procedures string */ &unpack_string_array, /* grib_unpack array procedures string */ &pack_bytes, /* grib_pack procedures bytes */ @@ -270,12 +278,10 @@ static int clear(grib_accessor* a) return GRIB_SUCCESS; } -// ECC-1467 -template <> -int GribAccessorClassGen::unpack(grib_accessor* a, long* v, size_t* len) +static int unpack_long(grib_accessor* a, long* v, size_t* len) { int type = GRIB_TYPE_UNDEFINED; - if (a->cclass->unpack_double && a->cclass->unpack_double != &GribAccessorClassGen::unpack) { + if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { double val = 0.0; size_t l = 1; grib_unpack_double(a, &val, &l); @@ -287,7 +293,7 @@ int GribAccessorClassGen::unpack(grib_accessor* a, long* v, size_t* len) return GRIB_SUCCESS; } - if (a->cclass->unpack_string && a->cclass->unpack_string != &GribAccessorClassGen::unpack) { + if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { char val[1024]; size_t l = sizeof(val); char* last = NULL; @@ -308,18 +314,64 @@ int GribAccessorClassGen::unpack(grib_accessor* a, long* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } -// ECC-1467 -template <> -int GribAccessorClassGen::unpack(grib_accessor* a, float* v, size_t* len) +template inline T _strtod(const char* val, char** last); +template <> inline float _strtod(const char* val, char** last) { + double v = strtod(val, last); + assert(v <= std::numeric_limits::max()); + return v; +} +template <> inline double _strtod(const char* val, char** last) { + return strtod(val, last); +} + +template +static int unpack(grib_accessor* a, T* v, size_t* len) { + int type = GRIB_TYPE_UNDEFINED; + if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { + long val = 0; + size_t l = 1; + grib_unpack_long(a, &val, &l); + *v = val; + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to %s", a->name, typeid(T).name()); + return GRIB_SUCCESS; + } + + if (a->cclass->unpack_string && a->cclass->unpack_string != &unpack_string) { + char val[1024]; + size_t l = sizeof(val); + char* last = NULL; + grib_unpack_string(a, val, &l); + + //*v = _strtod(val, &last); + *v = strtod(val, &last); + if (*last == 0) { /* conversion of string to double worked */ + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); + return GRIB_SUCCESS; + } + } + + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack as %s", a->name); + if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); + } + return GRIB_NOT_IMPLEMENTED; } -// ECC-1467 -template <> -int GribAccessorClassGen::unpack(grib_accessor* a, char* v, size_t* len) +static int unpack_double(grib_accessor* a, double* v, size_t* len) +{ + return unpack(a, v, len); +} + +static int unpack_float(grib_accessor* a, float* v, size_t* len) +{ + return unpack(a, v, len); +} + +static int unpack_string(grib_accessor* a, char* v, size_t* len) { - if (a->cclass->unpack_double && a->cclass->unpack_double != &GribAccessorClassGen::unpack) { + if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { double val = 0.0; size_t l = 1; grib_unpack_double(a, &val, &l); @@ -329,13 +381,13 @@ int GribAccessorClassGen::unpack(grib_accessor* a, char* v, size_t* len) return GRIB_SUCCESS; } - if (a->cclass->unpack_long && a->cclass->unpack_long != &GribAccessorClassGen::unpack) { + if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { long val = 0; size_t l = 1; grib_unpack_long(a, &val, &l); snprintf(v, 64, "%ld", val); *len = strlen(v); - grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string \n", a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name); return GRIB_SUCCESS; } diff --git a/src/grib_api_internal_cpp.h b/src/grib_api_internal_cpp.h index 5ff71478b..47ea00874 100644 --- a/src/grib_api_internal_cpp.h +++ b/src/grib_api_internal_cpp.h @@ -1,5 +1,6 @@ #pragma once +#include "grib_accessor.h" #include "grib_value.h" #include "grib_bits_any_endian_simple.h" #include "grib_ieeefloat.h" diff --git a/src/grib_bits_any_endian_simple.h b/src/grib_bits_any_endian_simple.h index 7c41f1c01..369b87067 100644 --- a/src/grib_bits_any_endian_simple.h +++ b/src/grib_bits_any_endian_simple.h @@ -17,7 +17,7 @@ int grib_decode_array(const unsigned char* p, long* bitp, long bitsPerValue, { size_t i = 0; unsigned long lvalue = 0; - double x; + T x; #if 0 /* slow reference code */ @@ -30,7 +30,7 @@ int grib_decode_array(const unsigned char* p, long* bitp, long bitsPerValue, *bitp += 1; } x=((lvalue*s)+reference_value)*d; - val[i] = (double)x; + val[i] = x; } #endif if (bitsPerValue % 8 == 0) { @@ -49,7 +49,7 @@ int grib_decode_array(const unsigned char* p, long* bitp, long bitsPerValue, lvalue |= p[o++]; } x = ((lvalue * s) + reference_value) * d; - val[i] = (T)x; + val[i] = x; /* *bitp += bitsPerValue * n_vals; */ } } @@ -90,7 +90,7 @@ int grib_decode_array(const unsigned char* p, long* bitp, long bitsPerValue, } /* scaling and move value to output */ x = ((lvalue * s) + reference_value) * d; - val[i] = (T)x; + val[i] = x; } } return 0; diff --git a/src/grib_value.cc b/src/grib_value.cc index 55f435db1..7fba5127d 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -11,10 +11,12 @@ * Jean Baptiste Filippi - 01.11.2005 * Enrico Fucile * ***************************************************************************/ -#include "grib_api_internal.h" +#include "grib_api_internal_cpp.h" #include "grib_value.h" #include + + /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) @@ -780,6 +782,7 @@ 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; @@ -861,7 +864,7 @@ int grib_set_force_float_array(grib_handle* h, const char* name, const float* va { /* 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_set_float_array(h, name, val, length, /*check=*/0); return GRIB_NOT_IMPLEMENTED; } @@ -871,7 +874,7 @@ int grib_set_double_array(grib_handle* h, const char* name, const double* val, s } 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_set_float_array(h, name, val, length, /*check=*/1); return GRIB_NOT_IMPLEMENTED; } @@ -1280,34 +1283,16 @@ const char* grib_get_accessor_class_name(grib_handle* h, const char* name) return act ? act->cclass->name : NULL; } -template <> -int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length) +template +static int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, T* val, size_t buffer_len, size_t* decoded_length) { + static_assert(std::is_floating_point::value, "Requires floating point numbers"); if (a) { - int err = _grib_get_array_internal(h, a->same, val, buffer_len, decoded_length); + int err = _grib_get_array_internal(h, a->same, val, buffer_len, decoded_length); if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; - err = grib_unpack_double(a, val + *decoded_length, &len); - *decoded_length += len; - } - - return err; - } - else { - return GRIB_SUCCESS; - } -} - -template <> -int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, float* val, size_t buffer_len, size_t* decoded_length) -{ - if (a) { - int err = _grib_get_array_internal(h, a->same, val, buffer_len, decoded_length); - - if (err == GRIB_SUCCESS) { - size_t len = buffer_len - *decoded_length; - err = grib_unpack_float(a, val + *decoded_length, &len); + err = grib_unpack(a, val + *decoded_length, &len); *decoded_length += len; } @@ -1328,27 +1313,7 @@ int grib_get_float_array_internal(const grib_handle* h, const char* name, float* return grib_get_array_internal(h, name, val, length); } -template <> -int grib_get_array(const grib_handle* h, const char* name, float* val, size_t *length) -{ - size_t len = *length; - grib_accessor* a = grib_find_accessor(h, name); - if (!a) return GRIB_NOT_FOUND; - - //[> TODO: For now only GRIB supported... no BUFR keys <] - if (h->product_kind != PRODUCT_GRIB) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_float_array only supported for GRIB"); - return GRIB_NOT_IMPLEMENTED; - } - Assert(name[0]!='/'); - Assert(name[0]!='#'); - *length = 0; - return _grib_get_array_internal(h,a,val,len,length); -} - - -template <> -int grib_get_array(const grib_handle* h, const char* name, double* val, size_t* length) +int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length) { size_t len = *length; grib_accessor* a = NULL; @@ -1368,7 +1333,7 @@ int grib_get_array(const grib_handle* h, const char* name, double* val, if (!a) return GRIB_NOT_FOUND; if (name[0] == '#') { - return grib_unpack_double(a, val, length); // TODO: change to template + return grib_unpack(a, val, length); } else { *length = 0; @@ -1377,14 +1342,33 @@ int grib_get_array(const grib_handle* h, const char* name, double* val, } } -int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length) +int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) +{ + size_t len = *length; + grib_accessor* a = grib_find_accessor(h, name); + if (!a) return GRIB_NOT_FOUND; + + //[> TODO: For now only GRIB supported... no BUFR keys <] + if (h->product_kind != PRODUCT_GRIB) { + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_float_array only supported for GRIB"); + return GRIB_NOT_IMPLEMENTED; + } + Assert(name[0]!='/'); + Assert(name[0]!='#'); + *length = 0; + return _grib_get_array_internal(h,a,val,len,length); +} + +template <> +int grib_get_array(const grib_handle* h, const char* name, float* val, size_t *length) { - return grib_get_array(h, name, val, length); + return grib_get_float_array(h, name, val, length); } -int grib_get_float_array(const grib_handle* h, const char* name, float* val, size_t *length) +template <> +int grib_get_array(const grib_handle* h, const char* name, double* val, size_t* length) { - return grib_get_array(h, name, val, length); + return grib_get_double_array(h, name, val, length); } int ecc__grib_get_string_length(grib_accessor* a, size_t* size) diff --git a/src/grib_value.h b/src/grib_value.h index 147633423..b0485de40 100644 --- a/src/grib_value.h +++ b/src/grib_value.h @@ -7,12 +7,10 @@ template int grib_get_array(const grib_handle* h, const char* name, T* val, size_t* length); -template -int _grib_get_array_internal(const grib_handle* h, grib_accessor* a, T* val, size_t buffer_len, size_t* decoded_length); - template int grib_get_array_internal(const grib_handle* h, const char* name, T* val, size_t* length) { + static_assert(std::is_floating_point::value, "Requires floating point numbers"); int ret = grib_get_array(h, name, val, length); if (ret != GRIB_SUCCESS) diff --git a/tests/grib_ecc-1467.cc b/tests/grib_ecc-1467.cc index 6cb063538..4696f73ae 100644 --- a/tests/grib_ecc-1467.cc +++ b/tests/grib_ecc-1467.cc @@ -24,8 +24,8 @@ int main(int argc, char** argv) size_t i = 0; double abs_error = 0; - double max_abs_error = 1e-04; - double tolerance = 1e-04; + double max_abs_error = 1e-03; + double tolerance = 1e-03; double dmin; double dmax; float fval; @@ -51,8 +51,8 @@ int main(int argc, char** argv) fvalues = (float*)malloc(values_len * sizeof(float)); dvalues = (double*)malloc(values_len * sizeof(double)); - CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); + CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); for (i = 0; i < values_len; i++) { abs_error = fabs(dvalues[i] - (double)fvalues[i]); diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh index de4ec274f..b948c771f 100755 --- a/tests/grib_ecc-1467.sh +++ b/tests/grib_ecc-1467.sh @@ -30,7 +30,7 @@ gfiles="$gfiles spherical_pressure_level.grib2" # spectral_complex, edition=2 gfiles="$gfiles gfs.complex.mvmu.grib2" # grid_complex, edition=2, g22order_packing # Second Order -#gfiles="$gfiles lfpw.grib1" # grid_second_order, edition=1 +gfiles="$gfiles lfpw.grib1" # grid_second_order, edition=1 #gfiles="$gfiles " # grid_second_order, edition=2 # CCSDS From 8486b71416f9a1f6246246e9d74dcb0af9dc2ec2 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 6 Mar 2023 14:48:29 +0000 Subject: [PATCH 135/212] ECC-1467: Missing header file --- src/grib_accessor.h | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/grib_accessor.h diff --git a/src/grib_accessor.h b/src/grib_accessor.h new file mode 100644 index 000000000..f91b6312b --- /dev/null +++ b/src/grib_accessor.h @@ -0,0 +1,5 @@ +# pragma once + +#include "grib_api_internal.h" + +template int grib_unpack(grib_accessor* a, T* v, size_t* len); From fba1fb206371d4f89917b712eb965b967b5684b3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Mar 2023 16:34:59 +0000 Subject: [PATCH 136/212] GRIB2: True Imagery templates --- definitions/grib2/tables/30/4.0.table | 7 +------ tests/CMakeLists.txt | 2 +- tests/grib_true-imagery.sh | 5 ++--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/definitions/grib2/tables/30/4.0.table b/definitions/grib2/tables/30/4.0.table index 9929cea35..3b35b9c5c 100644 --- a/definitions/grib2/tables/30/4.0.table +++ b/definitions/grib2/tables/30/4.0.table @@ -80,12 +80,7 @@ 96 96 Average, accumulation, extreme values or other statistically processed values of an individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time 97 97 Average, accumulation, extreme values or other statistically processed values of post-processing analysis or forecast at a horizontal level or in a horizontal layer at a specified local time 98 98 Average, accumulation, extreme values or other statistically processed values of a post-processing individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a specified local time -# 99-107 Reserved -108 108 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for generic optical properties -109 109 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for generic optical properties -110 110 Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties -111 111 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for generic optical properties -# 112-253 Reserved +# 99-253 Reserved 254 254 CCITT IA5 character string # 255-999 Reserved 1000 1000 Cross-section of analysis and forecast at a point in time diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 86a005337..1146d2d60 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -83,7 +83,7 @@ if( HAVE_BUILD_TOOLS ) grib_uerra grib_s2s grib_fire - grib_true-imagery + # grib_true_imagery grib_element grib_suppressed grib_2nd_order_numValues diff --git a/tests/grib_true-imagery.sh b/tests/grib_true-imagery.sh index 834fa415e..929eddb8d 100755 --- a/tests/grib_true-imagery.sh +++ b/tests/grib_true-imagery.sh @@ -9,9 +9,8 @@ # . ./include.ctest.sh -set -u -REDIRECT=/dev/null -label="grib_true-imagery_test" # Change prod to bufr or grib etc + +label="grib_true_imagery_test" temp=temp.$label tempd=temp_dump.$label sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl From eb4220f455ca2034d1d691e919e47c4bf3f2a008 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Mar 2023 20:50:11 +0000 Subject: [PATCH 137/212] Compiler warning: [-Walloc-size-larger-than=] --- tools/grib_to_netcdf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/grib_to_netcdf.cc b/tools/grib_to_netcdf.cc index ec7415688..a9af32dbd 100644 --- a/tools/grib_to_netcdf.cc +++ b/tools/grib_to_netcdf.cc @@ -1539,7 +1539,7 @@ static int cube_position(const hypercube* h, const request* r) static void reserve_index_cache(hypercube* h, int size) { - if (size == 0) + if (size <= 0) return; if (h->index_cache != 0) From 8b2290804ca85bef03a47e641c0c953a6118d1c9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 6 Mar 2023 20:54:34 +0000 Subject: [PATCH 138/212] Migration to C++: Comments --- tools/grib_tools.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index 0f2edd7e9..66cee8089 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -671,7 +671,7 @@ static void grib_print_header(grib_runtime_options* options, grib_handle* h) int width; int written_to_dump = 0; /* boolean */ if (options->json_output && !options->latlon) - return; /* For JSON output we do not print a single header for all msgs */ + return; // For JSON output we do not print a single header for all msgs if (options->handle_count != 1) return; @@ -712,9 +712,9 @@ static void grib_print_header(grib_runtime_options* options, grib_handle* h) static int cmpstringp(const void* p1, const void* p2) { - /* The actual arguments to this function are "pointers to - pointers to char", but strcmp(3) arguments are "pointers - to char", hence the following cast plus dereference */ + // The actual arguments to this function are "pointers to + // pointers to char", but strcmp(3) arguments are "pointers + // to char", hence the following cast plus dereference return strcmp(*(char* const*)p1, *(char* const*)p2); } @@ -765,9 +765,7 @@ static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle grib_keys_iterator_delete(kiter); if (options->print_keys_count == 0 && options->latlon == 0) { int j = 0, k = 0, ns_count = 0; - const char* all_namespace_vals[1024] = { - NULL, - }; /* sorted array containing all namespaces */ + const char* all_namespace_vals[1024] = {NULL,}; // sorted array containing all namespaces printf("ERROR: namespace \"%s\" does not contain any key.\n", ns); printf("Here are the available namespaces in this message:\n"); for (i = 0; i < ACCESSORS_ARRAY_SIZE; i++) { @@ -787,7 +785,7 @@ static void grib_tools_set_print_keys(grib_runtime_options* options, grib_handle if (all_namespace_vals[i]) { int print_it = 1; if (i > 0 && strcmp(all_namespace_vals[i], all_namespace_vals[i - 1]) == 0) { - print_it = 0; /* skip duplicate entries */ + print_it = 0; // skip duplicate entries } if (print_it) printf("\t%s\n", all_namespace_vals[i]); From 3a300d72d888a15d95806c72be444db122e01906 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 7 Mar 2023 15:23:51 +0000 Subject: [PATCH 139/212] Pseudo code --- src/grib_accessor_class_data_ccsds_packing.cc | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index a8c2d090d..28d8c61f0 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -669,15 +669,51 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array if (index_array[i] > size) return GRIB_INVALID_ARGUMENT; } - values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); - err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); - if (err) { - grib_context_free(a->context, values); - return err; - } - for (i = 0; i < len; i++) { - val_array[i] = values[index_array[i]]; + //values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); + //err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); + //if (err) { + // grib_context_free(a->context, values); + // return err; + //} + //for (i = 0; i < len; i++) { + // val_array[i] = values[index_array[i]]; + //} + + std::vector rsi_table; + + struct Redirection { + size_t buf_pos; // position in the buffer + size_t idx; // user-requested data + }; + + struct RsiBucket { + size_t rsi_idx; + std::vector redicrections; + }; + + unsigned char* buf = NULL; + size_t buflen = 0; + + buflen = grib_byte_count(a); + buf = (unsigned char*)hand->buffer->data; + buf += grib_byte_offset(a); + + size_t rsi_size = rsi * block_size; + std::vector buckets = create_buckets(index_array, rsi, block_size); + + aec_stream strm; + strm.flags = ccsds_flags; + strm.bits_per_sample = bits_per_value; + strm.block_size = ccsds_block_size; + strm.rsi = ccsds_rsi; + + for (auto bucket: buckets) { + unsigned char* rsi = aec_rsi_at(&strm, rsi_table[bucket.rsi_idx]); + for (auto r: bucket.redirections) { + values[bucket.pos] = rsi[bucket.idx - bucket.rsi_idx * rsi_size]; + } } + grib_context_free(a->context, values); return GRIB_SUCCESS; } From f1342af080d1498b5bd29015a7ea9670a147fd0e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Mar 2023 17:47:58 +0000 Subject: [PATCH 140/212] ECC-1540: Ensemble member issue with localDefinitionNumber=36 for param=210170 (VSO2) --- src/grib_util.cc | 19 +++++++++++-------- tests/grib_local.sh | 8 ++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index 3ffd94f2f..1c9023dbd 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1890,15 +1890,19 @@ int parse_keyval_string(const char* grib_tool, return GRIB_SUCCESS; } -// Return 1 if the productDefinitionTemplateNumber (GRIB2) is related to EPS +// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for EPS (ensemble) products int grib2_is_PDTN_EPS(long pdtn) { - return ( - pdtn == 1 || pdtn == 11 || - pdtn == 33 || pdtn == 34 || // simulated (synthetic) satellite data - pdtn == 41 || pdtn == 43 || // atmospheric chemical constituents - pdtn == 45 || pdtn == 47 || pdtn == 85 // aerosols - ); +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) + + static int eps_pdtns[] = { 1, 2, 3, 4, 11, 12, 13, 14, 33, 34, 41, 43, 45, 47, + 49, 54, 56, 58, 59, 60, 61, 63, 68, 71, 73, 77, 79, + 81, 83, 84, 85, 92, 94, 96, 98 }; + size_t i; + for (i = 0; i < NUMBER(eps_pdtns); ++i) { + if (eps_pdtns[i] == pdtn) return 1; + } + return 0; } // Return 1 if the productDefinitionTemplateNumber (GRIB2) is for atmospheric chemical constituents @@ -1963,7 +1967,6 @@ int grib2_is_PDTN_AerosolOptical(long pdtn) // is_eps: ensemble or deterministic // is_instant: instantaneous or interval-based // etc... -// int grib2_select_PDTN(int is_eps, int is_instant, int is_chemical, int is_chemical_srcsink, diff --git a/tests/grib_local.sh b/tests/grib_local.sh index e513a9fd0..3242a61f7 100755 --- a/tests/grib_local.sh +++ b/tests/grib_local.sh @@ -198,6 +198,14 @@ grib_check_key_equals $temp 'mars.iteration' '23' ${tools_dir}/grib_ls -jm $temp > $temp.1 grep -q "iteration.* 23" $temp.1 +# ECC-1540: Local Definition 36 +# -------------------------------- +${tools_dir}/grib_set -s \ + setLocalDefinition=1,localDefinitionNumber=36,paramId=210170,class=rd,type=4v,stream=elda \ + $sample_g2 $temp +grib_check_key_exists $temp mars.number,constituentType,sourceSinkChemicalPhysicalProcess +${tools_dir}/grib_set -s localDefinitionNumber=36 $temp $temp.1 +${tools_dir}/grib_compare $temp $temp.1 # Clean up rm -f $temp $temp.1 $temp.2 $temp.3 From 039cda5db00dda55707ded6c763c8d252f2401df Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 7 Mar 2023 21:57:22 +0000 Subject: [PATCH 141/212] Testing: Gaussian latitudes --- tests/unit_tests.cc | 1247 +------------------------------------------ 1 file changed, 1 insertion(+), 1246 deletions(-) diff --git a/tests/unit_tests.cc b/tests/unit_tests.cc index 505a2a78f..25ab24e88 100644 --- a/tests/unit_tests.cc +++ b/tests/unit_tests.cc @@ -124,1252 +124,7 @@ static void test_gaussian_latitude_640() compare_doubles(lats[13], 88.067032, tolerance); compare_doubles(lats[14], 87.926471, tolerance); compare_doubles(lats[15], 87.785908, tolerance); - compare_doubles(lats[16], 87.645345, tolerance); - compare_doubles(lats[17], 87.504781, tolerance); - compare_doubles(lats[18], 87.364216, tolerance); - compare_doubles(lats[19], 87.223651, tolerance); - compare_doubles(lats[20], 87.083085, tolerance); - compare_doubles(lats[21], 86.942519, tolerance); - compare_doubles(lats[22], 86.801952, tolerance); - compare_doubles(lats[23], 86.661385, tolerance); - compare_doubles(lats[24], 86.520818, tolerance); - compare_doubles(lats[25], 86.380251, tolerance); - compare_doubles(lats[26], 86.239684, tolerance); - compare_doubles(lats[27], 86.099116, tolerance); - compare_doubles(lats[28], 85.958548, tolerance); - compare_doubles(lats[29], 85.817980, tolerance); - compare_doubles(lats[30], 85.677412, tolerance); - compare_doubles(lats[31], 85.536844, tolerance); - compare_doubles(lats[32], 85.396275, tolerance); - compare_doubles(lats[33], 85.255707, tolerance); - compare_doubles(lats[34], 85.115138, tolerance); - compare_doubles(lats[35], 84.974570, tolerance); - compare_doubles(lats[36], 84.834001, tolerance); - compare_doubles(lats[37], 84.693432, tolerance); - compare_doubles(lats[38], 84.552863, tolerance); - compare_doubles(lats[39], 84.412294, tolerance); - compare_doubles(lats[40], 84.271725, tolerance); - compare_doubles(lats[41], 84.131156, tolerance); - compare_doubles(lats[42], 83.990587, tolerance); - compare_doubles(lats[43], 83.850018, tolerance); - compare_doubles(lats[44], 83.709449, tolerance); - compare_doubles(lats[45], 83.568880, tolerance); - compare_doubles(lats[46], 83.428310, tolerance); - compare_doubles(lats[47], 83.287741, tolerance); - compare_doubles(lats[48], 83.147172, tolerance); - compare_doubles(lats[49], 83.006602, tolerance); - compare_doubles(lats[50], 82.866033, tolerance); - compare_doubles(lats[51], 82.725464, tolerance); - compare_doubles(lats[52], 82.584894, tolerance); - compare_doubles(lats[53], 82.444325, tolerance); - compare_doubles(lats[54], 82.303755, tolerance); - compare_doubles(lats[55], 82.163186, tolerance); - compare_doubles(lats[56], 82.022616, tolerance); - compare_doubles(lats[57], 81.882047, tolerance); - compare_doubles(lats[58], 81.741477, tolerance); - compare_doubles(lats[59], 81.600908, tolerance); - compare_doubles(lats[60], 81.460338, tolerance); - compare_doubles(lats[61], 81.319768, tolerance); - compare_doubles(lats[62], 81.179199, tolerance); - compare_doubles(lats[63], 81.038629, tolerance); - compare_doubles(lats[64], 80.898059, tolerance); - compare_doubles(lats[65], 80.757490, tolerance); - compare_doubles(lats[66], 80.616920, tolerance); - compare_doubles(lats[67], 80.476350, tolerance); - compare_doubles(lats[68], 80.335781, tolerance); - compare_doubles(lats[69], 80.195211, tolerance); - compare_doubles(lats[70], 80.054641, tolerance); - compare_doubles(lats[71], 79.914072, tolerance); - compare_doubles(lats[72], 79.773502, tolerance); - compare_doubles(lats[73], 79.632932, tolerance); - compare_doubles(lats[74], 79.492362, tolerance); - compare_doubles(lats[75], 79.351792, tolerance); - compare_doubles(lats[76], 79.211223, tolerance); - compare_doubles(lats[77], 79.070653, tolerance); - compare_doubles(lats[78], 78.930083, tolerance); - compare_doubles(lats[79], 78.789513, tolerance); - compare_doubles(lats[80], 78.648943, tolerance); - compare_doubles(lats[81], 78.508374, tolerance); - compare_doubles(lats[82], 78.367804, tolerance); - compare_doubles(lats[83], 78.227234, tolerance); - compare_doubles(lats[84], 78.086664, tolerance); - compare_doubles(lats[85], 77.946094, tolerance); - compare_doubles(lats[86], 77.805524, tolerance); - compare_doubles(lats[87], 77.664955, tolerance); - compare_doubles(lats[88], 77.524385, tolerance); - compare_doubles(lats[89], 77.383815, tolerance); - compare_doubles(lats[90], 77.243245, tolerance); - compare_doubles(lats[91], 77.102675, tolerance); - compare_doubles(lats[92], 76.962105, tolerance); - compare_doubles(lats[93], 76.821535, tolerance); - compare_doubles(lats[94], 76.680966, tolerance); - compare_doubles(lats[95], 76.540396, tolerance); - compare_doubles(lats[96], 76.399826, tolerance); - compare_doubles(lats[97], 76.259256, tolerance); - compare_doubles(lats[98], 76.118686, tolerance); - compare_doubles(lats[99], 75.978116, tolerance); - compare_doubles(lats[100], 75.837546, tolerance); - compare_doubles(lats[101], 75.696976, tolerance); - compare_doubles(lats[102], 75.556406, tolerance); - compare_doubles(lats[103], 75.415836, tolerance); - compare_doubles(lats[104], 75.275266, tolerance); - compare_doubles(lats[105], 75.134697, tolerance); - compare_doubles(lats[106], 74.994127, tolerance); - compare_doubles(lats[107], 74.853557, tolerance); - compare_doubles(lats[108], 74.712987, tolerance); - compare_doubles(lats[109], 74.572417, tolerance); - compare_doubles(lats[110], 74.431847, tolerance); - compare_doubles(lats[111], 74.291277, tolerance); - compare_doubles(lats[112], 74.150707, tolerance); - compare_doubles(lats[113], 74.010137, tolerance); - compare_doubles(lats[114], 73.869567, tolerance); - compare_doubles(lats[115], 73.728997, tolerance); - compare_doubles(lats[116], 73.588427, tolerance); - compare_doubles(lats[117], 73.447857, tolerance); - compare_doubles(lats[118], 73.307287, tolerance); - compare_doubles(lats[119], 73.166717, tolerance); - compare_doubles(lats[120], 73.026147, tolerance); - compare_doubles(lats[121], 72.885577, tolerance); - compare_doubles(lats[122], 72.745007, tolerance); - compare_doubles(lats[123], 72.604437, tolerance); - compare_doubles(lats[124], 72.463867, tolerance); - compare_doubles(lats[125], 72.323298, tolerance); - compare_doubles(lats[126], 72.182728, tolerance); - compare_doubles(lats[127], 72.042158, tolerance); - compare_doubles(lats[128], 71.901588, tolerance); - compare_doubles(lats[129], 71.761018, tolerance); - compare_doubles(lats[130], 71.620448, tolerance); - compare_doubles(lats[131], 71.479878, tolerance); - compare_doubles(lats[132], 71.339308, tolerance); - compare_doubles(lats[133], 71.198738, tolerance); - compare_doubles(lats[134], 71.058168, tolerance); - compare_doubles(lats[135], 70.917598, tolerance); - compare_doubles(lats[136], 70.777028, tolerance); - compare_doubles(lats[137], 70.636458, tolerance); - compare_doubles(lats[138], 70.495888, tolerance); - compare_doubles(lats[139], 70.355318, tolerance); - compare_doubles(lats[140], 70.214748, tolerance); - compare_doubles(lats[141], 70.074178, tolerance); - compare_doubles(lats[142], 69.933608, tolerance); - compare_doubles(lats[143], 69.793038, tolerance); - compare_doubles(lats[144], 69.652468, tolerance); - compare_doubles(lats[145], 69.511898, tolerance); - compare_doubles(lats[146], 69.371328, tolerance); - compare_doubles(lats[147], 69.230758, tolerance); - compare_doubles(lats[148], 69.090188, tolerance); - compare_doubles(lats[149], 68.949618, tolerance); - compare_doubles(lats[150], 68.809048, tolerance); - compare_doubles(lats[151], 68.668478, tolerance); - compare_doubles(lats[152], 68.527908, tolerance); - compare_doubles(lats[153], 68.387338, tolerance); - compare_doubles(lats[154], 68.246768, tolerance); - compare_doubles(lats[155], 68.106198, tolerance); - compare_doubles(lats[156], 67.965628, tolerance); - compare_doubles(lats[157], 67.825058, tolerance); - compare_doubles(lats[158], 67.684488, tolerance); - compare_doubles(lats[159], 67.543918, tolerance); - compare_doubles(lats[160], 67.403348, tolerance); - compare_doubles(lats[161], 67.262778, tolerance); - compare_doubles(lats[162], 67.122208, tolerance); - compare_doubles(lats[163], 66.981638, tolerance); - compare_doubles(lats[164], 66.841067, tolerance); - compare_doubles(lats[165], 66.700497, tolerance); - compare_doubles(lats[166], 66.559927, tolerance); - compare_doubles(lats[167], 66.419357, tolerance); - compare_doubles(lats[168], 66.278787, tolerance); - compare_doubles(lats[169], 66.138217, tolerance); - compare_doubles(lats[170], 65.997647, tolerance); - compare_doubles(lats[171], 65.857077, tolerance); - compare_doubles(lats[172], 65.716507, tolerance); - compare_doubles(lats[173], 65.575937, tolerance); - compare_doubles(lats[174], 65.435367, tolerance); - compare_doubles(lats[175], 65.294797, tolerance); - compare_doubles(lats[176], 65.154227, tolerance); - compare_doubles(lats[177], 65.013657, tolerance); - compare_doubles(lats[178], 64.873087, tolerance); - compare_doubles(lats[179], 64.732517, tolerance); - compare_doubles(lats[180], 64.591947, tolerance); - compare_doubles(lats[181], 64.451377, tolerance); - compare_doubles(lats[182], 64.310807, tolerance); - compare_doubles(lats[183], 64.170237, tolerance); - compare_doubles(lats[184], 64.029667, tolerance); - compare_doubles(lats[185], 63.889097, tolerance); - compare_doubles(lats[186], 63.748527, tolerance); - compare_doubles(lats[187], 63.607957, tolerance); - compare_doubles(lats[188], 63.467387, tolerance); - compare_doubles(lats[189], 63.326817, tolerance); - compare_doubles(lats[190], 63.186247, tolerance); - compare_doubles(lats[191], 63.045677, tolerance); - compare_doubles(lats[192], 62.905107, tolerance); - compare_doubles(lats[193], 62.764537, tolerance); - compare_doubles(lats[194], 62.623967, tolerance); - compare_doubles(lats[195], 62.483397, tolerance); - compare_doubles(lats[196], 62.342826, tolerance); - compare_doubles(lats[197], 62.202256, tolerance); - compare_doubles(lats[198], 62.061686, tolerance); - compare_doubles(lats[199], 61.921116, tolerance); - compare_doubles(lats[200], 61.780546, tolerance); - compare_doubles(lats[201], 61.639976, tolerance); - compare_doubles(lats[202], 61.499406, tolerance); - compare_doubles(lats[203], 61.358836, tolerance); - compare_doubles(lats[204], 61.218266, tolerance); - compare_doubles(lats[205], 61.077696, tolerance); - compare_doubles(lats[206], 60.937126, tolerance); - compare_doubles(lats[207], 60.796556, tolerance); - compare_doubles(lats[208], 60.655986, tolerance); - compare_doubles(lats[209], 60.515416, tolerance); - compare_doubles(lats[210], 60.374846, tolerance); - compare_doubles(lats[211], 60.234276, tolerance); - compare_doubles(lats[212], 60.093706, tolerance); - compare_doubles(lats[213], 59.953136, tolerance); - compare_doubles(lats[214], 59.812566, tolerance); - compare_doubles(lats[215], 59.671996, tolerance); - compare_doubles(lats[216], 59.531426, tolerance); - compare_doubles(lats[217], 59.390856, tolerance); - compare_doubles(lats[218], 59.250286, tolerance); - compare_doubles(lats[219], 59.109715, tolerance); - compare_doubles(lats[220], 58.969145, tolerance); - compare_doubles(lats[221], 58.828575, tolerance); - compare_doubles(lats[222], 58.688005, tolerance); - compare_doubles(lats[223], 58.547435, tolerance); - compare_doubles(lats[224], 58.406865, tolerance); - compare_doubles(lats[225], 58.266295, tolerance); - compare_doubles(lats[226], 58.125725, tolerance); - compare_doubles(lats[227], 57.985155, tolerance); - compare_doubles(lats[228], 57.844585, tolerance); - compare_doubles(lats[229], 57.704015, tolerance); - compare_doubles(lats[230], 57.563445, tolerance); - compare_doubles(lats[231], 57.422875, tolerance); - compare_doubles(lats[232], 57.282305, tolerance); - compare_doubles(lats[233], 57.141735, tolerance); - compare_doubles(lats[234], 57.001165, tolerance); - compare_doubles(lats[235], 56.860595, tolerance); - compare_doubles(lats[236], 56.720025, tolerance); - compare_doubles(lats[237], 56.579455, tolerance); - compare_doubles(lats[238], 56.438884, tolerance); - compare_doubles(lats[239], 56.298314, tolerance); - compare_doubles(lats[240], 56.157744, tolerance); - compare_doubles(lats[241], 56.017174, tolerance); - compare_doubles(lats[242], 55.876604, tolerance); - compare_doubles(lats[243], 55.736034, tolerance); - compare_doubles(lats[244], 55.595464, tolerance); - compare_doubles(lats[245], 55.454894, tolerance); - compare_doubles(lats[246], 55.314324, tolerance); - compare_doubles(lats[247], 55.173754, tolerance); - compare_doubles(lats[248], 55.033184, tolerance); - compare_doubles(lats[249], 54.892614, tolerance); - compare_doubles(lats[250], 54.752044, tolerance); - compare_doubles(lats[251], 54.611474, tolerance); - compare_doubles(lats[252], 54.470904, tolerance); - compare_doubles(lats[253], 54.330334, tolerance); - compare_doubles(lats[254], 54.189764, tolerance); - compare_doubles(lats[255], 54.049194, tolerance); - compare_doubles(lats[256], 53.908623, tolerance); - compare_doubles(lats[257], 53.768053, tolerance); - compare_doubles(lats[258], 53.627483, tolerance); - compare_doubles(lats[259], 53.486913, tolerance); - compare_doubles(lats[260], 53.346343, tolerance); - compare_doubles(lats[261], 53.205773, tolerance); - compare_doubles(lats[262], 53.065203, tolerance); - compare_doubles(lats[263], 52.924633, tolerance); - compare_doubles(lats[264], 52.784063, tolerance); - compare_doubles(lats[265], 52.643493, tolerance); - compare_doubles(lats[266], 52.502923, tolerance); - compare_doubles(lats[267], 52.362353, tolerance); - compare_doubles(lats[268], 52.221783, tolerance); - compare_doubles(lats[269], 52.081213, tolerance); - compare_doubles(lats[270], 51.940643, tolerance); - compare_doubles(lats[271], 51.800073, tolerance); - compare_doubles(lats[272], 51.659502, tolerance); - compare_doubles(lats[273], 51.518932, tolerance); - compare_doubles(lats[274], 51.378362, tolerance); - compare_doubles(lats[275], 51.237792, tolerance); - compare_doubles(lats[276], 51.097222, tolerance); - compare_doubles(lats[277], 50.956652, tolerance); - compare_doubles(lats[278], 50.816082, tolerance); - compare_doubles(lats[279], 50.675512, tolerance); - compare_doubles(lats[280], 50.534942, tolerance); - compare_doubles(lats[281], 50.394372, tolerance); - compare_doubles(lats[282], 50.253802, tolerance); - compare_doubles(lats[283], 50.113232, tolerance); - compare_doubles(lats[284], 49.972662, tolerance); - compare_doubles(lats[285], 49.832092, tolerance); - compare_doubles(lats[286], 49.691522, tolerance); - compare_doubles(lats[287], 49.550952, tolerance); - compare_doubles(lats[288], 49.410381, tolerance); - compare_doubles(lats[289], 49.269811, tolerance); - compare_doubles(lats[290], 49.129241, tolerance); - compare_doubles(lats[291], 48.988671, tolerance); - compare_doubles(lats[292], 48.848101, tolerance); - compare_doubles(lats[293], 48.707531, tolerance); - compare_doubles(lats[294], 48.566961, tolerance); - compare_doubles(lats[295], 48.426391, tolerance); - compare_doubles(lats[296], 48.285821, tolerance); - compare_doubles(lats[297], 48.145251, tolerance); - compare_doubles(lats[298], 48.004681, tolerance); - compare_doubles(lats[299], 47.864111, tolerance); - compare_doubles(lats[300], 47.723541, tolerance); - compare_doubles(lats[301], 47.582971, tolerance); - compare_doubles(lats[302], 47.442401, tolerance); - compare_doubles(lats[303], 47.301830, tolerance); - compare_doubles(lats[304], 47.161260, tolerance); - compare_doubles(lats[305], 47.020690, tolerance); - compare_doubles(lats[306], 46.880120, tolerance); - compare_doubles(lats[307], 46.739550, tolerance); - compare_doubles(lats[308], 46.598980, tolerance); - compare_doubles(lats[309], 46.458410, tolerance); - compare_doubles(lats[310], 46.317840, tolerance); - compare_doubles(lats[311], 46.177270, tolerance); - compare_doubles(lats[312], 46.036700, tolerance); - compare_doubles(lats[313], 45.896130, tolerance); - compare_doubles(lats[314], 45.755560, tolerance); - compare_doubles(lats[315], 45.614990, tolerance); - compare_doubles(lats[316], 45.474420, tolerance); - compare_doubles(lats[317], 45.333850, tolerance); - compare_doubles(lats[318], 45.193279, tolerance); - compare_doubles(lats[319], 45.052709, tolerance); - compare_doubles(lats[320], 44.912139, tolerance); - compare_doubles(lats[321], 44.771569, tolerance); - compare_doubles(lats[322], 44.630999, tolerance); - compare_doubles(lats[323], 44.490429, tolerance); - compare_doubles(lats[324], 44.349859, tolerance); - compare_doubles(lats[325], 44.209289, tolerance); - compare_doubles(lats[326], 44.068719, tolerance); - compare_doubles(lats[327], 43.928149, tolerance); - compare_doubles(lats[328], 43.787579, tolerance); - compare_doubles(lats[329], 43.647009, tolerance); - compare_doubles(lats[330], 43.506439, tolerance); - compare_doubles(lats[331], 43.365869, tolerance); - compare_doubles(lats[332], 43.225299, tolerance); - compare_doubles(lats[333], 43.084728, tolerance); - compare_doubles(lats[334], 42.944158, tolerance); - compare_doubles(lats[335], 42.803588, tolerance); - compare_doubles(lats[336], 42.663018, tolerance); - compare_doubles(lats[337], 42.522448, tolerance); - compare_doubles(lats[338], 42.381878, tolerance); - compare_doubles(lats[339], 42.241308, tolerance); - compare_doubles(lats[340], 42.100738, tolerance); - compare_doubles(lats[341], 41.960168, tolerance); - compare_doubles(lats[342], 41.819598, tolerance); - compare_doubles(lats[343], 41.679028, tolerance); - compare_doubles(lats[344], 41.538458, tolerance); - compare_doubles(lats[345], 41.397888, tolerance); - compare_doubles(lats[346], 41.257318, tolerance); - compare_doubles(lats[347], 41.116747, tolerance); - compare_doubles(lats[348], 40.976177, tolerance); - compare_doubles(lats[349], 40.835607, tolerance); - compare_doubles(lats[350], 40.695037, tolerance); - compare_doubles(lats[351], 40.554467, tolerance); - compare_doubles(lats[352], 40.413897, tolerance); - compare_doubles(lats[353], 40.273327, tolerance); - compare_doubles(lats[354], 40.132757, tolerance); - compare_doubles(lats[355], 39.992187, tolerance); - compare_doubles(lats[356], 39.851617, tolerance); - compare_doubles(lats[357], 39.711047, tolerance); - compare_doubles(lats[358], 39.570477, tolerance); - compare_doubles(lats[359], 39.429907, tolerance); - compare_doubles(lats[360], 39.289337, tolerance); - compare_doubles(lats[361], 39.148766, tolerance); - compare_doubles(lats[362], 39.008196, tolerance); - compare_doubles(lats[363], 38.867626, tolerance); - compare_doubles(lats[364], 38.727056, tolerance); - compare_doubles(lats[365], 38.586486, tolerance); - compare_doubles(lats[366], 38.445916, tolerance); - compare_doubles(lats[367], 38.305346, tolerance); - compare_doubles(lats[368], 38.164776, tolerance); - compare_doubles(lats[369], 38.024206, tolerance); - compare_doubles(lats[370], 37.883636, tolerance); - compare_doubles(lats[371], 37.743066, tolerance); - compare_doubles(lats[372], 37.602496, tolerance); - compare_doubles(lats[373], 37.461926, tolerance); - compare_doubles(lats[374], 37.321356, tolerance); - compare_doubles(lats[375], 37.180785, tolerance); - compare_doubles(lats[376], 37.040215, tolerance); - compare_doubles(lats[377], 36.899645, tolerance); - compare_doubles(lats[378], 36.759075, tolerance); - compare_doubles(lats[379], 36.618505, tolerance); - compare_doubles(lats[380], 36.477935, tolerance); - compare_doubles(lats[381], 36.337365, tolerance); - compare_doubles(lats[382], 36.196795, tolerance); - compare_doubles(lats[383], 36.056225, tolerance); - compare_doubles(lats[384], 35.915655, tolerance); - compare_doubles(lats[385], 35.775085, tolerance); - compare_doubles(lats[386], 35.634515, tolerance); - compare_doubles(lats[387], 35.493945, tolerance); - compare_doubles(lats[388], 35.353374, tolerance); - compare_doubles(lats[389], 35.212804, tolerance); - compare_doubles(lats[390], 35.072234, tolerance); - compare_doubles(lats[391], 34.931664, tolerance); - compare_doubles(lats[392], 34.791094, tolerance); - compare_doubles(lats[393], 34.650524, tolerance); - compare_doubles(lats[394], 34.509954, tolerance); - compare_doubles(lats[395], 34.369384, tolerance); - compare_doubles(lats[396], 34.228814, tolerance); - compare_doubles(lats[397], 34.088244, tolerance); - compare_doubles(lats[398], 33.947674, tolerance); - compare_doubles(lats[399], 33.807104, tolerance); - compare_doubles(lats[400], 33.666534, tolerance); - compare_doubles(lats[401], 33.525964, tolerance); - compare_doubles(lats[402], 33.385393, tolerance); - compare_doubles(lats[403], 33.244823, tolerance); - compare_doubles(lats[404], 33.104253, tolerance); - compare_doubles(lats[405], 32.963683, tolerance); - compare_doubles(lats[406], 32.823113, tolerance); - compare_doubles(lats[407], 32.682543, tolerance); - compare_doubles(lats[408], 32.541973, tolerance); - compare_doubles(lats[409], 32.401403, tolerance); - compare_doubles(lats[410], 32.260833, tolerance); - compare_doubles(lats[411], 32.120263, tolerance); - compare_doubles(lats[412], 31.979693, tolerance); - compare_doubles(lats[413], 31.839123, tolerance); - compare_doubles(lats[414], 31.698553, tolerance); - compare_doubles(lats[415], 31.557982, tolerance); - compare_doubles(lats[416], 31.417412, tolerance); - compare_doubles(lats[417], 31.276842, tolerance); - compare_doubles(lats[418], 31.136272, tolerance); - compare_doubles(lats[419], 30.995702, tolerance); - compare_doubles(lats[420], 30.855132, tolerance); - compare_doubles(lats[421], 30.714562, tolerance); - compare_doubles(lats[422], 30.573992, tolerance); - compare_doubles(lats[423], 30.433422, tolerance); - compare_doubles(lats[424], 30.292852, tolerance); - compare_doubles(lats[425], 30.152282, tolerance); - compare_doubles(lats[426], 30.011712, tolerance); - compare_doubles(lats[427], 29.871142, tolerance); - compare_doubles(lats[428], 29.730572, tolerance); - compare_doubles(lats[429], 29.590001, tolerance); - compare_doubles(lats[430], 29.449431, tolerance); - compare_doubles(lats[431], 29.308861, tolerance); - compare_doubles(lats[432], 29.168291, tolerance); - compare_doubles(lats[433], 29.027721, tolerance); - compare_doubles(lats[434], 28.887151, tolerance); - compare_doubles(lats[435], 28.746581, tolerance); - compare_doubles(lats[436], 28.606011, tolerance); - compare_doubles(lats[437], 28.465441, tolerance); - compare_doubles(lats[438], 28.324871, tolerance); - compare_doubles(lats[439], 28.184301, tolerance); - compare_doubles(lats[440], 28.043731, tolerance); - compare_doubles(lats[441], 27.903161, tolerance); - compare_doubles(lats[442], 27.762590, tolerance); - compare_doubles(lats[443], 27.622020, tolerance); - compare_doubles(lats[444], 27.481450, tolerance); - compare_doubles(lats[445], 27.340880, tolerance); - compare_doubles(lats[446], 27.200310, tolerance); - compare_doubles(lats[447], 27.059740, tolerance); - compare_doubles(lats[448], 26.919170, tolerance); - compare_doubles(lats[449], 26.778600, tolerance); - compare_doubles(lats[450], 26.638030, tolerance); - compare_doubles(lats[451], 26.497460, tolerance); - compare_doubles(lats[452], 26.356890, tolerance); - compare_doubles(lats[453], 26.216320, tolerance); - compare_doubles(lats[454], 26.075750, tolerance); - compare_doubles(lats[455], 25.935179, tolerance); - compare_doubles(lats[456], 25.794609, tolerance); - compare_doubles(lats[457], 25.654039, tolerance); - compare_doubles(lats[458], 25.513469, tolerance); - compare_doubles(lats[459], 25.372899, tolerance); - compare_doubles(lats[460], 25.232329, tolerance); - compare_doubles(lats[461], 25.091759, tolerance); - compare_doubles(lats[462], 24.951189, tolerance); - compare_doubles(lats[463], 24.810619, tolerance); - compare_doubles(lats[464], 24.670049, tolerance); - compare_doubles(lats[465], 24.529479, tolerance); - compare_doubles(lats[466], 24.388909, tolerance); - compare_doubles(lats[467], 24.248339, tolerance); - compare_doubles(lats[468], 24.107768, tolerance); - compare_doubles(lats[469], 23.967198, tolerance); - compare_doubles(lats[470], 23.826628, tolerance); - compare_doubles(lats[471], 23.686058, tolerance); - compare_doubles(lats[472], 23.545488, tolerance); - compare_doubles(lats[473], 23.404918, tolerance); - compare_doubles(lats[474], 23.264348, tolerance); - compare_doubles(lats[475], 23.123778, tolerance); - compare_doubles(lats[476], 22.983208, tolerance); - compare_doubles(lats[477], 22.842638, tolerance); - compare_doubles(lats[478], 22.702068, tolerance); - compare_doubles(lats[479], 22.561498, tolerance); - compare_doubles(lats[480], 22.420928, tolerance); - compare_doubles(lats[481], 22.280357, tolerance); - compare_doubles(lats[482], 22.139787, tolerance); - compare_doubles(lats[483], 21.999217, tolerance); - compare_doubles(lats[484], 21.858647, tolerance); - compare_doubles(lats[485], 21.718077, tolerance); - compare_doubles(lats[486], 21.577507, tolerance); - compare_doubles(lats[487], 21.436937, tolerance); - compare_doubles(lats[488], 21.296367, tolerance); - compare_doubles(lats[489], 21.155797, tolerance); - compare_doubles(lats[490], 21.015227, tolerance); - compare_doubles(lats[491], 20.874657, tolerance); - compare_doubles(lats[492], 20.734087, tolerance); - compare_doubles(lats[493], 20.593517, tolerance); - compare_doubles(lats[494], 20.452946, tolerance); - compare_doubles(lats[495], 20.312376, tolerance); - compare_doubles(lats[496], 20.171806, tolerance); - compare_doubles(lats[497], 20.031236, tolerance); - compare_doubles(lats[498], 19.890666, tolerance); - compare_doubles(lats[499], 19.750096, tolerance); - compare_doubles(lats[500], 19.609526, tolerance); - compare_doubles(lats[501], 19.468956, tolerance); - compare_doubles(lats[502], 19.328386, tolerance); - compare_doubles(lats[503], 19.187816, tolerance); - compare_doubles(lats[504], 19.047246, tolerance); - compare_doubles(lats[505], 18.906676, tolerance); - compare_doubles(lats[506], 18.766106, tolerance); - compare_doubles(lats[507], 18.625535, tolerance); - compare_doubles(lats[508], 18.484965, tolerance); - compare_doubles(lats[509], 18.344395, tolerance); - compare_doubles(lats[510], 18.203825, tolerance); - compare_doubles(lats[511], 18.063255, tolerance); - compare_doubles(lats[512], 17.922685, tolerance); - compare_doubles(lats[513], 17.782115, tolerance); - compare_doubles(lats[514], 17.641545, tolerance); - compare_doubles(lats[515], 17.500975, tolerance); - compare_doubles(lats[516], 17.360405, tolerance); - compare_doubles(lats[517], 17.219835, tolerance); - compare_doubles(lats[518], 17.079265, tolerance); - compare_doubles(lats[519], 16.938694, tolerance); - compare_doubles(lats[520], 16.798124, tolerance); - compare_doubles(lats[521], 16.657554, tolerance); - compare_doubles(lats[522], 16.516984, tolerance); - compare_doubles(lats[523], 16.376414, tolerance); - compare_doubles(lats[524], 16.235844, tolerance); - compare_doubles(lats[525], 16.095274, tolerance); - compare_doubles(lats[526], 15.954704, tolerance); - compare_doubles(lats[527], 15.814134, tolerance); - compare_doubles(lats[528], 15.673564, tolerance); - compare_doubles(lats[529], 15.532994, tolerance); - compare_doubles(lats[530], 15.392424, tolerance); - compare_doubles(lats[531], 15.251854, tolerance); - compare_doubles(lats[532], 15.111283, tolerance); - compare_doubles(lats[533], 14.970713, tolerance); - compare_doubles(lats[534], 14.830143, tolerance); - compare_doubles(lats[535], 14.689573, tolerance); - compare_doubles(lats[536], 14.549003, tolerance); - compare_doubles(lats[537], 14.408433, tolerance); - compare_doubles(lats[538], 14.267863, tolerance); - compare_doubles(lats[539], 14.127293, tolerance); - compare_doubles(lats[540], 13.986723, tolerance); - compare_doubles(lats[541], 13.846153, tolerance); - compare_doubles(lats[542], 13.705583, tolerance); - compare_doubles(lats[543], 13.565013, tolerance); - compare_doubles(lats[544], 13.424443, tolerance); - compare_doubles(lats[545], 13.283872, tolerance); - compare_doubles(lats[546], 13.143302, tolerance); - compare_doubles(lats[547], 13.002732, tolerance); - compare_doubles(lats[548], 12.862162, tolerance); - compare_doubles(lats[549], 12.721592, tolerance); - compare_doubles(lats[550], 12.581022, tolerance); - compare_doubles(lats[551], 12.440452, tolerance); - compare_doubles(lats[552], 12.299882, tolerance); - compare_doubles(lats[553], 12.159312, tolerance); - compare_doubles(lats[554], 12.018742, tolerance); - compare_doubles(lats[555], 11.878172, tolerance); - compare_doubles(lats[556], 11.737602, tolerance); - compare_doubles(lats[557], 11.597032, tolerance); - compare_doubles(lats[558], 11.456461, tolerance); - compare_doubles(lats[559], 11.315891, tolerance); - compare_doubles(lats[560], 11.175321, tolerance); - compare_doubles(lats[561], 11.034751, tolerance); - compare_doubles(lats[562], 10.894181, tolerance); - compare_doubles(lats[563], 10.753611, tolerance); - compare_doubles(lats[564], 10.613041, tolerance); - compare_doubles(lats[565], 10.472471, tolerance); - compare_doubles(lats[566], 10.331901, tolerance); - compare_doubles(lats[567], 10.191331, tolerance); - compare_doubles(lats[568], 10.050761, tolerance); - compare_doubles(lats[569], 9.910191, tolerance); - compare_doubles(lats[570], 9.769620, tolerance); - compare_doubles(lats[571], 9.629050, tolerance); - compare_doubles(lats[572], 9.488480, tolerance); - compare_doubles(lats[573], 9.347910, tolerance); - compare_doubles(lats[574], 9.207340, tolerance); - compare_doubles(lats[575], 9.066770, tolerance); - compare_doubles(lats[576], 8.926200, tolerance); - compare_doubles(lats[577], 8.785630, tolerance); - compare_doubles(lats[578], 8.645060, tolerance); - compare_doubles(lats[579], 8.504490, tolerance); - compare_doubles(lats[580], 8.363920, tolerance); - compare_doubles(lats[581], 8.223350, tolerance); - compare_doubles(lats[582], 8.082780, tolerance); - compare_doubles(lats[583], 7.942209, tolerance); - compare_doubles(lats[584], 7.801639, tolerance); - compare_doubles(lats[585], 7.661069, tolerance); - compare_doubles(lats[586], 7.520499, tolerance); - compare_doubles(lats[587], 7.379929, tolerance); - compare_doubles(lats[588], 7.239359, tolerance); - compare_doubles(lats[589], 7.098789, tolerance); - compare_doubles(lats[590], 6.958219, tolerance); - compare_doubles(lats[591], 6.817649, tolerance); - compare_doubles(lats[592], 6.677079, tolerance); - compare_doubles(lats[593], 6.536509, tolerance); - compare_doubles(lats[594], 6.395939, tolerance); - compare_doubles(lats[595], 6.255369, tolerance); - compare_doubles(lats[596], 6.114798, tolerance); - compare_doubles(lats[597], 5.974228, tolerance); - compare_doubles(lats[598], 5.833658, tolerance); - compare_doubles(lats[599], 5.693088, tolerance); - compare_doubles(lats[600], 5.552518, tolerance); - compare_doubles(lats[601], 5.411948, tolerance); - compare_doubles(lats[602], 5.271378, tolerance); - compare_doubles(lats[603], 5.130808, tolerance); - compare_doubles(lats[604], 4.990238, tolerance); - compare_doubles(lats[605], 4.849668, tolerance); - compare_doubles(lats[606], 4.709098, tolerance); - compare_doubles(lats[607], 4.568528, tolerance); - compare_doubles(lats[608], 4.427957, tolerance); - compare_doubles(lats[609], 4.287387, tolerance); - compare_doubles(lats[610], 4.146817, tolerance); - compare_doubles(lats[611], 4.006247, tolerance); - compare_doubles(lats[612], 3.865677, tolerance); - compare_doubles(lats[613], 3.725107, tolerance); - compare_doubles(lats[614], 3.584537, tolerance); - compare_doubles(lats[615], 3.443967, tolerance); - compare_doubles(lats[616], 3.303397, tolerance); - compare_doubles(lats[617], 3.162827, tolerance); - compare_doubles(lats[618], 3.022257, tolerance); - compare_doubles(lats[619], 2.881687, tolerance); - compare_doubles(lats[620], 2.741117, tolerance); - compare_doubles(lats[621], 2.600546, tolerance); - compare_doubles(lats[622], 2.459976, tolerance); - compare_doubles(lats[623], 2.319406, tolerance); - compare_doubles(lats[624], 2.178836, tolerance); - compare_doubles(lats[625], 2.038266, tolerance); - compare_doubles(lats[626], 1.897696, tolerance); - compare_doubles(lats[627], 1.757126, tolerance); - compare_doubles(lats[628], 1.616556, tolerance); - compare_doubles(lats[629], 1.475986, tolerance); - compare_doubles(lats[630], 1.335416, tolerance); - compare_doubles(lats[631], 1.194846, tolerance); - compare_doubles(lats[632], 1.054276, tolerance); - compare_doubles(lats[633], 0.913706, tolerance); - compare_doubles(lats[634], 0.773135, tolerance); - compare_doubles(lats[635], 0.632565, tolerance); - compare_doubles(lats[636], 0.491995, tolerance); - compare_doubles(lats[637], 0.351425, tolerance); - compare_doubles(lats[638], 0.210855, tolerance); - compare_doubles(lats[639], 0.070285, tolerance); - compare_doubles(lats[640], -0.070285, tolerance); - compare_doubles(lats[641], -0.210855, tolerance); - compare_doubles(lats[642], -0.351425, tolerance); - compare_doubles(lats[643], -0.491995, tolerance); - compare_doubles(lats[644], -0.632565, tolerance); - compare_doubles(lats[645], -0.773135, tolerance); - compare_doubles(lats[646], -0.913706, tolerance); - compare_doubles(lats[647], -1.054276, tolerance); - compare_doubles(lats[648], -1.194846, tolerance); - compare_doubles(lats[649], -1.335416, tolerance); - compare_doubles(lats[650], -1.475986, tolerance); - compare_doubles(lats[651], -1.616556, tolerance); - compare_doubles(lats[652], -1.757126, tolerance); - compare_doubles(lats[653], -1.897696, tolerance); - compare_doubles(lats[654], -2.038266, tolerance); - compare_doubles(lats[655], -2.178836, tolerance); - compare_doubles(lats[656], -2.319406, tolerance); - compare_doubles(lats[657], -2.459976, tolerance); - compare_doubles(lats[658], -2.600546, tolerance); - compare_doubles(lats[659], -2.741117, tolerance); - compare_doubles(lats[660], -2.881687, tolerance); - compare_doubles(lats[661], -3.022257, tolerance); - compare_doubles(lats[662], -3.162827, tolerance); - compare_doubles(lats[663], -3.303397, tolerance); - compare_doubles(lats[664], -3.443967, tolerance); - compare_doubles(lats[665], -3.584537, tolerance); - compare_doubles(lats[666], -3.725107, tolerance); - compare_doubles(lats[667], -3.865677, tolerance); - compare_doubles(lats[668], -4.006247, tolerance); - compare_doubles(lats[669], -4.146817, tolerance); - compare_doubles(lats[670], -4.287387, tolerance); - compare_doubles(lats[671], -4.427957, tolerance); - compare_doubles(lats[672], -4.568528, tolerance); - compare_doubles(lats[673], -4.709098, tolerance); - compare_doubles(lats[674], -4.849668, tolerance); - compare_doubles(lats[675], -4.990238, tolerance); - compare_doubles(lats[676], -5.130808, tolerance); - compare_doubles(lats[677], -5.271378, tolerance); - compare_doubles(lats[678], -5.411948, tolerance); - compare_doubles(lats[679], -5.552518, tolerance); - compare_doubles(lats[680], -5.693088, tolerance); - compare_doubles(lats[681], -5.833658, tolerance); - compare_doubles(lats[682], -5.974228, tolerance); - compare_doubles(lats[683], -6.114798, tolerance); - compare_doubles(lats[684], -6.255369, tolerance); - compare_doubles(lats[685], -6.395939, tolerance); - compare_doubles(lats[686], -6.536509, tolerance); - compare_doubles(lats[687], -6.677079, tolerance); - compare_doubles(lats[688], -6.817649, tolerance); - compare_doubles(lats[689], -6.958219, tolerance); - compare_doubles(lats[690], -7.098789, tolerance); - compare_doubles(lats[691], -7.239359, tolerance); - compare_doubles(lats[692], -7.379929, tolerance); - compare_doubles(lats[693], -7.520499, tolerance); - compare_doubles(lats[694], -7.661069, tolerance); - compare_doubles(lats[695], -7.801639, tolerance); - compare_doubles(lats[696], -7.942209, tolerance); - compare_doubles(lats[697], -8.082780, tolerance); - compare_doubles(lats[698], -8.223350, tolerance); - compare_doubles(lats[699], -8.363920, tolerance); - compare_doubles(lats[700], -8.504490, tolerance); - compare_doubles(lats[701], -8.645060, tolerance); - compare_doubles(lats[702], -8.785630, tolerance); - compare_doubles(lats[703], -8.926200, tolerance); - compare_doubles(lats[704], -9.066770, tolerance); - compare_doubles(lats[705], -9.207340, tolerance); - compare_doubles(lats[706], -9.347910, tolerance); - compare_doubles(lats[707], -9.488480, tolerance); - compare_doubles(lats[708], -9.629050, tolerance); - compare_doubles(lats[709], -9.769620, tolerance); - compare_doubles(lats[710], -9.910191, tolerance); - compare_doubles(lats[711], -10.050761, tolerance); - compare_doubles(lats[712], -10.191331, tolerance); - compare_doubles(lats[713], -10.331901, tolerance); - compare_doubles(lats[714], -10.472471, tolerance); - compare_doubles(lats[715], -10.613041, tolerance); - compare_doubles(lats[716], -10.753611, tolerance); - compare_doubles(lats[717], -10.894181, tolerance); - compare_doubles(lats[718], -11.034751, tolerance); - compare_doubles(lats[719], -11.175321, tolerance); - compare_doubles(lats[720], -11.315891, tolerance); - compare_doubles(lats[721], -11.456461, tolerance); - compare_doubles(lats[722], -11.597032, tolerance); - compare_doubles(lats[723], -11.737602, tolerance); - compare_doubles(lats[724], -11.878172, tolerance); - compare_doubles(lats[725], -12.018742, tolerance); - compare_doubles(lats[726], -12.159312, tolerance); - compare_doubles(lats[727], -12.299882, tolerance); - compare_doubles(lats[728], -12.440452, tolerance); - compare_doubles(lats[729], -12.581022, tolerance); - compare_doubles(lats[730], -12.721592, tolerance); - compare_doubles(lats[731], -12.862162, tolerance); - compare_doubles(lats[732], -13.002732, tolerance); - compare_doubles(lats[733], -13.143302, tolerance); - compare_doubles(lats[734], -13.283872, tolerance); - compare_doubles(lats[735], -13.424443, tolerance); - compare_doubles(lats[736], -13.565013, tolerance); - compare_doubles(lats[737], -13.705583, tolerance); - compare_doubles(lats[738], -13.846153, tolerance); - compare_doubles(lats[739], -13.986723, tolerance); - compare_doubles(lats[740], -14.127293, tolerance); - compare_doubles(lats[741], -14.267863, tolerance); - compare_doubles(lats[742], -14.408433, tolerance); - compare_doubles(lats[743], -14.549003, tolerance); - compare_doubles(lats[744], -14.689573, tolerance); - compare_doubles(lats[745], -14.830143, tolerance); - compare_doubles(lats[746], -14.970713, tolerance); - compare_doubles(lats[747], -15.111283, tolerance); - compare_doubles(lats[748], -15.251854, tolerance); - compare_doubles(lats[749], -15.392424, tolerance); - compare_doubles(lats[750], -15.532994, tolerance); - compare_doubles(lats[751], -15.673564, tolerance); - compare_doubles(lats[752], -15.814134, tolerance); - compare_doubles(lats[753], -15.954704, tolerance); - compare_doubles(lats[754], -16.095274, tolerance); - compare_doubles(lats[755], -16.235844, tolerance); - compare_doubles(lats[756], -16.376414, tolerance); - compare_doubles(lats[757], -16.516984, tolerance); - compare_doubles(lats[758], -16.657554, tolerance); - compare_doubles(lats[759], -16.798124, tolerance); - compare_doubles(lats[760], -16.938694, tolerance); - compare_doubles(lats[761], -17.079265, tolerance); - compare_doubles(lats[762], -17.219835, tolerance); - compare_doubles(lats[763], -17.360405, tolerance); - compare_doubles(lats[764], -17.500975, tolerance); - compare_doubles(lats[765], -17.641545, tolerance); - compare_doubles(lats[766], -17.782115, tolerance); - compare_doubles(lats[767], -17.922685, tolerance); - compare_doubles(lats[768], -18.063255, tolerance); - compare_doubles(lats[769], -18.203825, tolerance); - compare_doubles(lats[770], -18.344395, tolerance); - compare_doubles(lats[771], -18.484965, tolerance); - compare_doubles(lats[772], -18.625535, tolerance); - compare_doubles(lats[773], -18.766106, tolerance); - compare_doubles(lats[774], -18.906676, tolerance); - compare_doubles(lats[775], -19.047246, tolerance); - compare_doubles(lats[776], -19.187816, tolerance); - compare_doubles(lats[777], -19.328386, tolerance); - compare_doubles(lats[778], -19.468956, tolerance); - compare_doubles(lats[779], -19.609526, tolerance); - compare_doubles(lats[780], -19.750096, tolerance); - compare_doubles(lats[781], -19.890666, tolerance); - compare_doubles(lats[782], -20.031236, tolerance); - compare_doubles(lats[783], -20.171806, tolerance); - compare_doubles(lats[784], -20.312376, tolerance); - compare_doubles(lats[785], -20.452946, tolerance); - compare_doubles(lats[786], -20.593517, tolerance); - compare_doubles(lats[787], -20.734087, tolerance); - compare_doubles(lats[788], -20.874657, tolerance); - compare_doubles(lats[789], -21.015227, tolerance); - compare_doubles(lats[790], -21.155797, tolerance); - compare_doubles(lats[791], -21.296367, tolerance); - compare_doubles(lats[792], -21.436937, tolerance); - compare_doubles(lats[793], -21.577507, tolerance); - compare_doubles(lats[794], -21.718077, tolerance); - compare_doubles(lats[795], -21.858647, tolerance); - compare_doubles(lats[796], -21.999217, tolerance); - compare_doubles(lats[797], -22.139787, tolerance); - compare_doubles(lats[798], -22.280357, tolerance); - compare_doubles(lats[799], -22.420928, tolerance); - compare_doubles(lats[800], -22.561498, tolerance); - compare_doubles(lats[801], -22.702068, tolerance); - compare_doubles(lats[802], -22.842638, tolerance); - compare_doubles(lats[803], -22.983208, tolerance); - compare_doubles(lats[804], -23.123778, tolerance); - compare_doubles(lats[805], -23.264348, tolerance); - compare_doubles(lats[806], -23.404918, tolerance); - compare_doubles(lats[807], -23.545488, tolerance); - compare_doubles(lats[808], -23.686058, tolerance); - compare_doubles(lats[809], -23.826628, tolerance); - compare_doubles(lats[810], -23.967198, tolerance); - compare_doubles(lats[811], -24.107768, tolerance); - compare_doubles(lats[812], -24.248339, tolerance); - compare_doubles(lats[813], -24.388909, tolerance); - compare_doubles(lats[814], -24.529479, tolerance); - compare_doubles(lats[815], -24.670049, tolerance); - compare_doubles(lats[816], -24.810619, tolerance); - compare_doubles(lats[817], -24.951189, tolerance); - compare_doubles(lats[818], -25.091759, tolerance); - compare_doubles(lats[819], -25.232329, tolerance); - compare_doubles(lats[820], -25.372899, tolerance); - compare_doubles(lats[821], -25.513469, tolerance); - compare_doubles(lats[822], -25.654039, tolerance); - compare_doubles(lats[823], -25.794609, tolerance); - compare_doubles(lats[824], -25.935179, tolerance); - compare_doubles(lats[825], -26.075750, tolerance); - compare_doubles(lats[826], -26.216320, tolerance); - compare_doubles(lats[827], -26.356890, tolerance); - compare_doubles(lats[828], -26.497460, tolerance); - compare_doubles(lats[829], -26.638030, tolerance); - compare_doubles(lats[830], -26.778600, tolerance); - compare_doubles(lats[831], -26.919170, tolerance); - compare_doubles(lats[832], -27.059740, tolerance); - compare_doubles(lats[833], -27.200310, tolerance); - compare_doubles(lats[834], -27.340880, tolerance); - compare_doubles(lats[835], -27.481450, tolerance); - compare_doubles(lats[836], -27.622020, tolerance); - compare_doubles(lats[837], -27.762590, tolerance); - compare_doubles(lats[838], -27.903161, tolerance); - compare_doubles(lats[839], -28.043731, tolerance); - compare_doubles(lats[840], -28.184301, tolerance); - compare_doubles(lats[841], -28.324871, tolerance); - compare_doubles(lats[842], -28.465441, tolerance); - compare_doubles(lats[843], -28.606011, tolerance); - compare_doubles(lats[844], -28.746581, tolerance); - compare_doubles(lats[845], -28.887151, tolerance); - compare_doubles(lats[846], -29.027721, tolerance); - compare_doubles(lats[847], -29.168291, tolerance); - compare_doubles(lats[848], -29.308861, tolerance); - compare_doubles(lats[849], -29.449431, tolerance); - compare_doubles(lats[850], -29.590001, tolerance); - compare_doubles(lats[851], -29.730572, tolerance); - compare_doubles(lats[852], -29.871142, tolerance); - compare_doubles(lats[853], -30.011712, tolerance); - compare_doubles(lats[854], -30.152282, tolerance); - compare_doubles(lats[855], -30.292852, tolerance); - compare_doubles(lats[856], -30.433422, tolerance); - compare_doubles(lats[857], -30.573992, tolerance); - compare_doubles(lats[858], -30.714562, tolerance); - compare_doubles(lats[859], -30.855132, tolerance); - compare_doubles(lats[860], -30.995702, tolerance); - compare_doubles(lats[861], -31.136272, tolerance); - compare_doubles(lats[862], -31.276842, tolerance); - compare_doubles(lats[863], -31.417412, tolerance); - compare_doubles(lats[864], -31.557982, tolerance); - compare_doubles(lats[865], -31.698553, tolerance); - compare_doubles(lats[866], -31.839123, tolerance); - compare_doubles(lats[867], -31.979693, tolerance); - compare_doubles(lats[868], -32.120263, tolerance); - compare_doubles(lats[869], -32.260833, tolerance); - compare_doubles(lats[870], -32.401403, tolerance); - compare_doubles(lats[871], -32.541973, tolerance); - compare_doubles(lats[872], -32.682543, tolerance); - compare_doubles(lats[873], -32.823113, tolerance); - compare_doubles(lats[874], -32.963683, tolerance); - compare_doubles(lats[875], -33.104253, tolerance); - compare_doubles(lats[876], -33.244823, tolerance); - compare_doubles(lats[877], -33.385393, tolerance); - compare_doubles(lats[878], -33.525964, tolerance); - compare_doubles(lats[879], -33.666534, tolerance); - compare_doubles(lats[880], -33.807104, tolerance); - compare_doubles(lats[881], -33.947674, tolerance); - compare_doubles(lats[882], -34.088244, tolerance); - compare_doubles(lats[883], -34.228814, tolerance); - compare_doubles(lats[884], -34.369384, tolerance); - compare_doubles(lats[885], -34.509954, tolerance); - compare_doubles(lats[886], -34.650524, tolerance); - compare_doubles(lats[887], -34.791094, tolerance); - compare_doubles(lats[888], -34.931664, tolerance); - compare_doubles(lats[889], -35.072234, tolerance); - compare_doubles(lats[890], -35.212804, tolerance); - compare_doubles(lats[891], -35.353374, tolerance); - compare_doubles(lats[892], -35.493945, tolerance); - compare_doubles(lats[893], -35.634515, tolerance); - compare_doubles(lats[894], -35.775085, tolerance); - compare_doubles(lats[895], -35.915655, tolerance); - compare_doubles(lats[896], -36.056225, tolerance); - compare_doubles(lats[897], -36.196795, tolerance); - compare_doubles(lats[898], -36.337365, tolerance); - compare_doubles(lats[899], -36.477935, tolerance); - compare_doubles(lats[900], -36.618505, tolerance); - compare_doubles(lats[901], -36.759075, tolerance); - compare_doubles(lats[902], -36.899645, tolerance); - compare_doubles(lats[903], -37.040215, tolerance); - compare_doubles(lats[904], -37.180785, tolerance); - compare_doubles(lats[905], -37.321356, tolerance); - compare_doubles(lats[906], -37.461926, tolerance); - compare_doubles(lats[907], -37.602496, tolerance); - compare_doubles(lats[908], -37.743066, tolerance); - compare_doubles(lats[909], -37.883636, tolerance); - compare_doubles(lats[910], -38.024206, tolerance); - compare_doubles(lats[911], -38.164776, tolerance); - compare_doubles(lats[912], -38.305346, tolerance); - compare_doubles(lats[913], -38.445916, tolerance); - compare_doubles(lats[914], -38.586486, tolerance); - compare_doubles(lats[915], -38.727056, tolerance); - compare_doubles(lats[916], -38.867626, tolerance); - compare_doubles(lats[917], -39.008196, tolerance); - compare_doubles(lats[918], -39.148766, tolerance); - compare_doubles(lats[919], -39.289337, tolerance); - compare_doubles(lats[920], -39.429907, tolerance); - compare_doubles(lats[921], -39.570477, tolerance); - compare_doubles(lats[922], -39.711047, tolerance); - compare_doubles(lats[923], -39.851617, tolerance); - compare_doubles(lats[924], -39.992187, tolerance); - compare_doubles(lats[925], -40.132757, tolerance); - compare_doubles(lats[926], -40.273327, tolerance); - compare_doubles(lats[927], -40.413897, tolerance); - compare_doubles(lats[928], -40.554467, tolerance); - compare_doubles(lats[929], -40.695037, tolerance); - compare_doubles(lats[930], -40.835607, tolerance); - compare_doubles(lats[931], -40.976177, tolerance); - compare_doubles(lats[932], -41.116747, tolerance); - compare_doubles(lats[933], -41.257318, tolerance); - compare_doubles(lats[934], -41.397888, tolerance); - compare_doubles(lats[935], -41.538458, tolerance); - compare_doubles(lats[936], -41.679028, tolerance); - compare_doubles(lats[937], -41.819598, tolerance); - compare_doubles(lats[938], -41.960168, tolerance); - compare_doubles(lats[939], -42.100738, tolerance); - compare_doubles(lats[940], -42.241308, tolerance); - compare_doubles(lats[941], -42.381878, tolerance); - compare_doubles(lats[942], -42.522448, tolerance); - compare_doubles(lats[943], -42.663018, tolerance); - compare_doubles(lats[944], -42.803588, tolerance); - compare_doubles(lats[945], -42.944158, tolerance); - compare_doubles(lats[946], -43.084728, tolerance); - compare_doubles(lats[947], -43.225299, tolerance); - compare_doubles(lats[948], -43.365869, tolerance); - compare_doubles(lats[949], -43.506439, tolerance); - compare_doubles(lats[950], -43.647009, tolerance); - compare_doubles(lats[951], -43.787579, tolerance); - compare_doubles(lats[952], -43.928149, tolerance); - compare_doubles(lats[953], -44.068719, tolerance); - compare_doubles(lats[954], -44.209289, tolerance); - compare_doubles(lats[955], -44.349859, tolerance); - compare_doubles(lats[956], -44.490429, tolerance); - compare_doubles(lats[957], -44.630999, tolerance); - compare_doubles(lats[958], -44.771569, tolerance); - compare_doubles(lats[959], -44.912139, tolerance); - compare_doubles(lats[960], -45.052709, tolerance); - compare_doubles(lats[961], -45.193279, tolerance); - compare_doubles(lats[962], -45.333850, tolerance); - compare_doubles(lats[963], -45.474420, tolerance); - compare_doubles(lats[964], -45.614990, tolerance); - compare_doubles(lats[965], -45.755560, tolerance); - compare_doubles(lats[966], -45.896130, tolerance); - compare_doubles(lats[967], -46.036700, tolerance); - compare_doubles(lats[968], -46.177270, tolerance); - compare_doubles(lats[969], -46.317840, tolerance); - compare_doubles(lats[970], -46.458410, tolerance); - compare_doubles(lats[971], -46.598980, tolerance); - compare_doubles(lats[972], -46.739550, tolerance); - compare_doubles(lats[973], -46.880120, tolerance); - compare_doubles(lats[974], -47.020690, tolerance); - compare_doubles(lats[975], -47.161260, tolerance); - compare_doubles(lats[976], -47.301830, tolerance); - compare_doubles(lats[977], -47.442401, tolerance); - compare_doubles(lats[978], -47.582971, tolerance); - compare_doubles(lats[979], -47.723541, tolerance); - compare_doubles(lats[980], -47.864111, tolerance); - compare_doubles(lats[981], -48.004681, tolerance); - compare_doubles(lats[982], -48.145251, tolerance); - compare_doubles(lats[983], -48.285821, tolerance); - compare_doubles(lats[984], -48.426391, tolerance); - compare_doubles(lats[985], -48.566961, tolerance); - compare_doubles(lats[986], -48.707531, tolerance); - compare_doubles(lats[987], -48.848101, tolerance); - compare_doubles(lats[988], -48.988671, tolerance); - compare_doubles(lats[989], -49.129241, tolerance); - compare_doubles(lats[990], -49.269811, tolerance); - compare_doubles(lats[991], -49.410381, tolerance); - compare_doubles(lats[992], -49.550952, tolerance); - compare_doubles(lats[993], -49.691522, tolerance); - compare_doubles(lats[994], -49.832092, tolerance); - compare_doubles(lats[995], -49.972662, tolerance); - compare_doubles(lats[996], -50.113232, tolerance); - compare_doubles(lats[997], -50.253802, tolerance); - compare_doubles(lats[998], -50.394372, tolerance); - compare_doubles(lats[999], -50.534942, tolerance); - compare_doubles(lats[1000], -50.675512, tolerance); - compare_doubles(lats[1001], -50.816082, tolerance); - compare_doubles(lats[1002], -50.956652, tolerance); - compare_doubles(lats[1003], -51.097222, tolerance); - compare_doubles(lats[1004], -51.237792, tolerance); - compare_doubles(lats[1005], -51.378362, tolerance); - compare_doubles(lats[1006], -51.518932, tolerance); - compare_doubles(lats[1007], -51.659502, tolerance); - compare_doubles(lats[1008], -51.800073, tolerance); - compare_doubles(lats[1009], -51.940643, tolerance); - compare_doubles(lats[1010], -52.081213, tolerance); - compare_doubles(lats[1011], -52.221783, tolerance); - compare_doubles(lats[1012], -52.362353, tolerance); - compare_doubles(lats[1013], -52.502923, tolerance); - compare_doubles(lats[1014], -52.643493, tolerance); - compare_doubles(lats[1015], -52.784063, tolerance); - compare_doubles(lats[1016], -52.924633, tolerance); - compare_doubles(lats[1017], -53.065203, tolerance); - compare_doubles(lats[1018], -53.205773, tolerance); - compare_doubles(lats[1019], -53.346343, tolerance); - compare_doubles(lats[1020], -53.486913, tolerance); - compare_doubles(lats[1021], -53.627483, tolerance); - compare_doubles(lats[1022], -53.768053, tolerance); - compare_doubles(lats[1023], -53.908623, tolerance); - compare_doubles(lats[1024], -54.049194, tolerance); - compare_doubles(lats[1025], -54.189764, tolerance); - compare_doubles(lats[1026], -54.330334, tolerance); - compare_doubles(lats[1027], -54.470904, tolerance); - compare_doubles(lats[1028], -54.611474, tolerance); - compare_doubles(lats[1029], -54.752044, tolerance); - compare_doubles(lats[1030], -54.892614, tolerance); - compare_doubles(lats[1031], -55.033184, tolerance); - compare_doubles(lats[1032], -55.173754, tolerance); - compare_doubles(lats[1033], -55.314324, tolerance); - compare_doubles(lats[1034], -55.454894, tolerance); - compare_doubles(lats[1035], -55.595464, tolerance); - compare_doubles(lats[1036], -55.736034, tolerance); - compare_doubles(lats[1037], -55.876604, tolerance); - compare_doubles(lats[1038], -56.017174, tolerance); - compare_doubles(lats[1039], -56.157744, tolerance); - compare_doubles(lats[1040], -56.298314, tolerance); - compare_doubles(lats[1041], -56.438884, tolerance); - compare_doubles(lats[1042], -56.579455, tolerance); - compare_doubles(lats[1043], -56.720025, tolerance); - compare_doubles(lats[1044], -56.860595, tolerance); - compare_doubles(lats[1045], -57.001165, tolerance); - compare_doubles(lats[1046], -57.141735, tolerance); - compare_doubles(lats[1047], -57.282305, tolerance); - compare_doubles(lats[1048], -57.422875, tolerance); - compare_doubles(lats[1049], -57.563445, tolerance); - compare_doubles(lats[1050], -57.704015, tolerance); - compare_doubles(lats[1051], -57.844585, tolerance); - compare_doubles(lats[1052], -57.985155, tolerance); - compare_doubles(lats[1053], -58.125725, tolerance); - compare_doubles(lats[1054], -58.266295, tolerance); - compare_doubles(lats[1055], -58.406865, tolerance); - compare_doubles(lats[1056], -58.547435, tolerance); - compare_doubles(lats[1057], -58.688005, tolerance); - compare_doubles(lats[1058], -58.828575, tolerance); - compare_doubles(lats[1059], -58.969145, tolerance); - compare_doubles(lats[1060], -59.109715, tolerance); - compare_doubles(lats[1061], -59.250286, tolerance); - compare_doubles(lats[1062], -59.390856, tolerance); - compare_doubles(lats[1063], -59.531426, tolerance); - compare_doubles(lats[1064], -59.671996, tolerance); - compare_doubles(lats[1065], -59.812566, tolerance); - compare_doubles(lats[1066], -59.953136, tolerance); - compare_doubles(lats[1067], -60.093706, tolerance); - compare_doubles(lats[1068], -60.234276, tolerance); - compare_doubles(lats[1069], -60.374846, tolerance); - compare_doubles(lats[1070], -60.515416, tolerance); - compare_doubles(lats[1071], -60.655986, tolerance); - compare_doubles(lats[1072], -60.796556, tolerance); - compare_doubles(lats[1073], -60.937126, tolerance); - compare_doubles(lats[1074], -61.077696, tolerance); - compare_doubles(lats[1075], -61.218266, tolerance); - compare_doubles(lats[1076], -61.358836, tolerance); - compare_doubles(lats[1077], -61.499406, tolerance); - compare_doubles(lats[1078], -61.639976, tolerance); - compare_doubles(lats[1079], -61.780546, tolerance); - compare_doubles(lats[1080], -61.921116, tolerance); - compare_doubles(lats[1081], -62.061686, tolerance); - compare_doubles(lats[1082], -62.202256, tolerance); - compare_doubles(lats[1083], -62.342826, tolerance); - compare_doubles(lats[1084], -62.483397, tolerance); - compare_doubles(lats[1085], -62.623967, tolerance); - compare_doubles(lats[1086], -62.764537, tolerance); - compare_doubles(lats[1087], -62.905107, tolerance); - compare_doubles(lats[1088], -63.045677, tolerance); - compare_doubles(lats[1089], -63.186247, tolerance); - compare_doubles(lats[1090], -63.326817, tolerance); - compare_doubles(lats[1091], -63.467387, tolerance); - compare_doubles(lats[1092], -63.607957, tolerance); - compare_doubles(lats[1093], -63.748527, tolerance); - compare_doubles(lats[1094], -63.889097, tolerance); - compare_doubles(lats[1095], -64.029667, tolerance); - compare_doubles(lats[1096], -64.170237, tolerance); - compare_doubles(lats[1097], -64.310807, tolerance); - compare_doubles(lats[1098], -64.451377, tolerance); - compare_doubles(lats[1099], -64.591947, tolerance); - compare_doubles(lats[1100], -64.732517, tolerance); - compare_doubles(lats[1101], -64.873087, tolerance); - compare_doubles(lats[1102], -65.013657, tolerance); - compare_doubles(lats[1103], -65.154227, tolerance); - compare_doubles(lats[1104], -65.294797, tolerance); - compare_doubles(lats[1105], -65.435367, tolerance); - compare_doubles(lats[1106], -65.575937, tolerance); - compare_doubles(lats[1107], -65.716507, tolerance); - compare_doubles(lats[1108], -65.857077, tolerance); - compare_doubles(lats[1109], -65.997647, tolerance); - compare_doubles(lats[1110], -66.138217, tolerance); - compare_doubles(lats[1111], -66.278787, tolerance); - compare_doubles(lats[1112], -66.419357, tolerance); - compare_doubles(lats[1113], -66.559927, tolerance); - compare_doubles(lats[1114], -66.700497, tolerance); - compare_doubles(lats[1115], -66.841067, tolerance); - compare_doubles(lats[1116], -66.981638, tolerance); - compare_doubles(lats[1117], -67.122208, tolerance); - compare_doubles(lats[1118], -67.262778, tolerance); - compare_doubles(lats[1119], -67.403348, tolerance); - compare_doubles(lats[1120], -67.543918, tolerance); - compare_doubles(lats[1121], -67.684488, tolerance); - compare_doubles(lats[1122], -67.825058, tolerance); - compare_doubles(lats[1123], -67.965628, tolerance); - compare_doubles(lats[1124], -68.106198, tolerance); - compare_doubles(lats[1125], -68.246768, tolerance); - compare_doubles(lats[1126], -68.387338, tolerance); - compare_doubles(lats[1127], -68.527908, tolerance); - compare_doubles(lats[1128], -68.668478, tolerance); - compare_doubles(lats[1129], -68.809048, tolerance); - compare_doubles(lats[1130], -68.949618, tolerance); - compare_doubles(lats[1131], -69.090188, tolerance); - compare_doubles(lats[1132], -69.230758, tolerance); - compare_doubles(lats[1133], -69.371328, tolerance); - compare_doubles(lats[1134], -69.511898, tolerance); - compare_doubles(lats[1135], -69.652468, tolerance); - compare_doubles(lats[1136], -69.793038, tolerance); - compare_doubles(lats[1137], -69.933608, tolerance); - compare_doubles(lats[1138], -70.074178, tolerance); - compare_doubles(lats[1139], -70.214748, tolerance); - compare_doubles(lats[1140], -70.355318, tolerance); - compare_doubles(lats[1141], -70.495888, tolerance); - compare_doubles(lats[1142], -70.636458, tolerance); - compare_doubles(lats[1143], -70.777028, tolerance); - compare_doubles(lats[1144], -70.917598, tolerance); - compare_doubles(lats[1145], -71.058168, tolerance); - compare_doubles(lats[1146], -71.198738, tolerance); - compare_doubles(lats[1147], -71.339308, tolerance); - compare_doubles(lats[1148], -71.479878, tolerance); - compare_doubles(lats[1149], -71.620448, tolerance); - compare_doubles(lats[1150], -71.761018, tolerance); - compare_doubles(lats[1151], -71.901588, tolerance); - compare_doubles(lats[1152], -72.042158, tolerance); - compare_doubles(lats[1153], -72.182728, tolerance); - compare_doubles(lats[1154], -72.323298, tolerance); - compare_doubles(lats[1155], -72.463867, tolerance); - compare_doubles(lats[1156], -72.604437, tolerance); - compare_doubles(lats[1157], -72.745007, tolerance); - compare_doubles(lats[1158], -72.885577, tolerance); - compare_doubles(lats[1159], -73.026147, tolerance); - compare_doubles(lats[1160], -73.166717, tolerance); - compare_doubles(lats[1161], -73.307287, tolerance); - compare_doubles(lats[1162], -73.447857, tolerance); - compare_doubles(lats[1163], -73.588427, tolerance); - compare_doubles(lats[1164], -73.728997, tolerance); - compare_doubles(lats[1165], -73.869567, tolerance); - compare_doubles(lats[1166], -74.010137, tolerance); - compare_doubles(lats[1167], -74.150707, tolerance); - compare_doubles(lats[1168], -74.291277, tolerance); - compare_doubles(lats[1169], -74.431847, tolerance); - compare_doubles(lats[1170], -74.572417, tolerance); - compare_doubles(lats[1171], -74.712987, tolerance); - compare_doubles(lats[1172], -74.853557, tolerance); - compare_doubles(lats[1173], -74.994127, tolerance); - compare_doubles(lats[1174], -75.134697, tolerance); - compare_doubles(lats[1175], -75.275266, tolerance); - compare_doubles(lats[1176], -75.415836, tolerance); - compare_doubles(lats[1177], -75.556406, tolerance); - compare_doubles(lats[1178], -75.696976, tolerance); - compare_doubles(lats[1179], -75.837546, tolerance); - compare_doubles(lats[1180], -75.978116, tolerance); - compare_doubles(lats[1181], -76.118686, tolerance); - compare_doubles(lats[1182], -76.259256, tolerance); - compare_doubles(lats[1183], -76.399826, tolerance); - compare_doubles(lats[1184], -76.540396, tolerance); - compare_doubles(lats[1185], -76.680966, tolerance); - compare_doubles(lats[1186], -76.821535, tolerance); - compare_doubles(lats[1187], -76.962105, tolerance); - compare_doubles(lats[1188], -77.102675, tolerance); - compare_doubles(lats[1189], -77.243245, tolerance); - compare_doubles(lats[1190], -77.383815, tolerance); - compare_doubles(lats[1191], -77.524385, tolerance); - compare_doubles(lats[1192], -77.664955, tolerance); - compare_doubles(lats[1193], -77.805524, tolerance); - compare_doubles(lats[1194], -77.946094, tolerance); - compare_doubles(lats[1195], -78.086664, tolerance); - compare_doubles(lats[1196], -78.227234, tolerance); - compare_doubles(lats[1197], -78.367804, tolerance); - compare_doubles(lats[1198], -78.508374, tolerance); - compare_doubles(lats[1199], -78.648943, tolerance); - compare_doubles(lats[1200], -78.789513, tolerance); - compare_doubles(lats[1201], -78.930083, tolerance); - compare_doubles(lats[1202], -79.070653, tolerance); - compare_doubles(lats[1203], -79.211223, tolerance); - compare_doubles(lats[1204], -79.351792, tolerance); - compare_doubles(lats[1205], -79.492362, tolerance); - compare_doubles(lats[1206], -79.632932, tolerance); - compare_doubles(lats[1207], -79.773502, tolerance); - compare_doubles(lats[1208], -79.914072, tolerance); - compare_doubles(lats[1209], -80.054641, tolerance); - compare_doubles(lats[1210], -80.195211, tolerance); - compare_doubles(lats[1211], -80.335781, tolerance); - compare_doubles(lats[1212], -80.476350, tolerance); - compare_doubles(lats[1213], -80.616920, tolerance); - compare_doubles(lats[1214], -80.757490, tolerance); - compare_doubles(lats[1215], -80.898059, tolerance); - compare_doubles(lats[1216], -81.038629, tolerance); - compare_doubles(lats[1217], -81.179199, tolerance); - compare_doubles(lats[1218], -81.319768, tolerance); - compare_doubles(lats[1219], -81.460338, tolerance); - compare_doubles(lats[1220], -81.600908, tolerance); - compare_doubles(lats[1221], -81.741477, tolerance); - compare_doubles(lats[1222], -81.882047, tolerance); - compare_doubles(lats[1223], -82.022616, tolerance); - compare_doubles(lats[1224], -82.163186, tolerance); - compare_doubles(lats[1225], -82.303755, tolerance); - compare_doubles(lats[1226], -82.444325, tolerance); - compare_doubles(lats[1227], -82.584894, tolerance); - compare_doubles(lats[1228], -82.725464, tolerance); - compare_doubles(lats[1229], -82.866033, tolerance); - compare_doubles(lats[1230], -83.006602, tolerance); - compare_doubles(lats[1231], -83.147172, tolerance); - compare_doubles(lats[1232], -83.287741, tolerance); - compare_doubles(lats[1233], -83.428310, tolerance); - compare_doubles(lats[1234], -83.568880, tolerance); - compare_doubles(lats[1235], -83.709449, tolerance); - compare_doubles(lats[1236], -83.850018, tolerance); - compare_doubles(lats[1237], -83.990587, tolerance); - compare_doubles(lats[1238], -84.131156, tolerance); - compare_doubles(lats[1239], -84.271725, tolerance); - compare_doubles(lats[1240], -84.412294, tolerance); - compare_doubles(lats[1241], -84.552863, tolerance); - compare_doubles(lats[1242], -84.693432, tolerance); - compare_doubles(lats[1243], -84.834001, tolerance); - compare_doubles(lats[1244], -84.974570, tolerance); - compare_doubles(lats[1245], -85.115138, tolerance); - compare_doubles(lats[1246], -85.255707, tolerance); - compare_doubles(lats[1247], -85.396275, tolerance); - compare_doubles(lats[1248], -85.536844, tolerance); - compare_doubles(lats[1249], -85.677412, tolerance); - compare_doubles(lats[1250], -85.817980, tolerance); - compare_doubles(lats[1251], -85.958548, tolerance); - compare_doubles(lats[1252], -86.099116, tolerance); - compare_doubles(lats[1253], -86.239684, tolerance); - compare_doubles(lats[1254], -86.380251, tolerance); - compare_doubles(lats[1255], -86.520818, tolerance); - compare_doubles(lats[1256], -86.661385, tolerance); - compare_doubles(lats[1257], -86.801952, tolerance); - compare_doubles(lats[1258], -86.942519, tolerance); - compare_doubles(lats[1259], -87.083085, tolerance); - compare_doubles(lats[1260], -87.223651, tolerance); - compare_doubles(lats[1261], -87.364216, tolerance); + compare_doubles(lats[1262], -87.504781, tolerance); compare_doubles(lats[1263], -87.645345, tolerance); compare_doubles(lats[1264], -87.785908, tolerance); From 74778b34e59351655f131cbe43d068014604b974 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Mar 2023 13:48:26 +0000 Subject: [PATCH 142/212] ECC-1540: Modify list --- src/grib_util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index 1c9023dbd..fc5057eb9 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1895,7 +1895,7 @@ int grib2_is_PDTN_EPS(long pdtn) { #define NUMBER(x) (sizeof(x) / sizeof(x[0])) - static int eps_pdtns[] = { 1, 2, 3, 4, 11, 12, 13, 14, 33, 34, 41, 43, 45, 47, + static int eps_pdtns[] = { 1, 11, 33, 34, 41, 43, 45, 47, 49, 54, 56, 58, 59, 60, 61, 63, 68, 71, 73, 77, 79, 81, 83, 84, 85, 92, 94, 96, 98 }; size_t i; From 3f023081f8944b6b718d58f08e59302dc98d9da2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Mar 2023 13:54:07 +0000 Subject: [PATCH 143/212] Add error checking --- src/grib_accessor_class_g2_eps.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/grib_accessor_class_g2_eps.cc b/src/grib_accessor_class_g2_eps.cc index 7dc3a09ab..2f042a935 100644 --- a/src/grib_accessor_class_g2_eps.cc +++ b/src/grib_accessor_class_g2_eps.cc @@ -165,8 +165,10 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; long productDefinitionTemplateNumber = 0; + int err = 0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + err = grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + if (err) return err; *val = 0; if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) From c74b74269d24367e605fcaabf892e516936fb418 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 8 Mar 2023 15:05:26 +0000 Subject: [PATCH 144/212] GRIB2: Simplify the EPS test --- src/grib_accessor_class_g2_aerosol.cc | 3 ++- src/grib_accessor_class_g2_chemical.cc | 3 ++- src/grib_accessor_class_g2_eps.cc | 8 ++++++-- src/grib_accessor_class_local_definition.cc | 5 ++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/grib_accessor_class_g2_aerosol.cc b/src/grib_accessor_class_g2_aerosol.cc index 8974efb57..2e4083faa 100644 --- a/src/grib_accessor_class_g2_aerosol.cc +++ b/src/grib_accessor_class_g2_aerosol.cc @@ -191,7 +191,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) ret = grib_get_string(hand, self->stepType, stepType, &slen); Assert(ret == GRIB_SUCCESS); - eps = grib2_is_PDTN_EPS(productDefinitionTemplateNumber); + //eps = grib2_is_PDTN_EPS(productDefinitionTemplateNumber); + eps = grib_is_defined(hand, "perturbationNumber"); if (!strcmp(stepType, "instant")) isInstant = 1; diff --git a/src/grib_accessor_class_g2_chemical.cc b/src/grib_accessor_class_g2_chemical.cc index d5edd07a9..49ecfc4a9 100644 --- a/src/grib_accessor_class_g2_chemical.cc +++ b/src/grib_accessor_class_g2_chemical.cc @@ -199,7 +199,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) ret = grib_get_string(hand, self->stepType, stepType, &slen); Assert(ret == GRIB_SUCCESS); - eps = grib2_is_PDTN_EPS(productDefinitionTemplateNumber); + eps = grib_is_defined(hand, "perturbationNumber"); + //eps = grib2_is_PDTN_EPS(productDefinitionTemplateNumber); if (!strcmp(stepType, "instant")) isInstant = 1; diff --git a/src/grib_accessor_class_g2_eps.cc b/src/grib_accessor_class_g2_eps.cc index 2f042a935..9003eb4f2 100644 --- a/src/grib_accessor_class_g2_eps.cc +++ b/src/grib_accessor_class_g2_eps.cc @@ -166,13 +166,17 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) grib_accessor_g2_eps* self = (grib_accessor_g2_eps*)a; long productDefinitionTemplateNumber = 0; int err = 0; + grib_handle* hand = grib_handle_of_accessor(a); - err = grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + err = grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); if (err) return err; *val = 0; - if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) + if (grib_is_defined(hand, "perturbationNumber")) { *val = 1; + } + //if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) + // *val = 1; return GRIB_SUCCESS; } diff --git a/src/grib_accessor_class_local_definition.cc b/src/grib_accessor_class_local_definition.cc index 5240eb129..1fefcaa5c 100644 --- a/src/grib_accessor_class_local_definition.cc +++ b/src/grib_accessor_class_local_definition.cc @@ -230,8 +230,11 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_ENCODING_ERROR; } - if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) + if (grib_is_defined(hand, "perturbationNumber")) { eps = 1; + } + //if (grib2_is_PDTN_EPS(productDefinitionTemplateNumber)) + // eps = 1; switch (localDefinitionNumber) { case 0: From 58ee3be16582d71226b251f58ba59878a70c8984 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 8 Mar 2023 15:30:50 +0000 Subject: [PATCH 145/212] ECC-1467: Revert changes in the unpack_double_element_set() function --- src/grib_accessor_class_data_ccsds_packing.cc | 51 +++---------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 28d8c61f0..85b654d02 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -669,49 +669,14 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array if (index_array[i] > size) return GRIB_INVALID_ARGUMENT; } - //values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); - //err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); - //if (err) { - // grib_context_free(a->context, values); - // return err; - //} - //for (i = 0; i < len; i++) { - // val_array[i] = values[index_array[i]]; - //} - - std::vector rsi_table; - - struct Redirection { - size_t buf_pos; // position in the buffer - size_t idx; // user-requested data - }; - - struct RsiBucket { - size_t rsi_idx; - std::vector redicrections; - }; - - unsigned char* buf = NULL; - size_t buflen = 0; - - buflen = grib_byte_count(a); - buf = (unsigned char*)hand->buffer->data; - buf += grib_byte_offset(a); - - size_t rsi_size = rsi * block_size; - std::vector buckets = create_buckets(index_array, rsi, block_size); - - aec_stream strm; - strm.flags = ccsds_flags; - strm.bits_per_sample = bits_per_value; - strm.block_size = ccsds_block_size; - strm.rsi = ccsds_rsi; - - for (auto bucket: buckets) { - unsigned char* rsi = aec_rsi_at(&strm, rsi_table[bucket.rsi_idx]); - for (auto r: bucket.redirections) { - values[bucket.pos] = rsi[bucket.idx - bucket.rsi_idx * rsi_size]; - } + values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double)); + err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size); + if (err) { + grib_context_free(a->context, values); + return err; + } + for (i = 0; i < len; i++) { + val_array[i] = values[index_array[i]]; } grib_context_free(a->context, values); From 8425eeb03cf4414a431ca4677e9e6fa3d48bd872 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 8 Mar 2023 16:13:17 +0000 Subject: [PATCH 146/212] ECC-1467: Minor changes --- ...accessor_class_data_apply_boustrophedonic.cc | 3 +-- src/grib_accessor_class_data_ccsds_packing.cc | 17 ++++++++--------- src/grib_accessor_class_data_raw_packing.cc | 1 - src/grib_accessor_class_data_simple_packing.cc | 1 - src/grib_accessor_class_gen.cc | 11 ----------- src/grib_value.cc | 1 - tests/grib_ecc-1467.cc | 2 +- 7 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.cc b/src/grib_accessor_class_data_apply_boustrophedonic.cc index cc5ef3a42..d1f2bbfbd 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/grib_accessor_class_data_apply_boustrophedonic.cc @@ -41,7 +41,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int get_native_type(grib_accessor*); static int pack_double(grib_accessor*, const double* val, size_t* len); -template static int unpack(grib_accessor*, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); @@ -190,7 +189,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) long* pl = 0; double* values = 0; double* pvalues = 0; - T* pval = 0; + T* pval = 0; size_t valuesSize = 0; long i, j; int ret; diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 85b654d02..988762732 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -50,7 +50,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -template static int unpack(grib_accessor* a, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); @@ -551,13 +550,13 @@ static int unpack(grib_accessor* a, T* val, size_t* len) buf = (unsigned char*)hand->buffer->data; buf += grib_byte_offset(a); -strm.flags = ccsds_flags; -strm.bits_per_sample = bits_per_value; -strm.block_size = ccsds_block_size; -strm.rsi = ccsds_rsi; + strm.flags = ccsds_flags; + strm.bits_per_sample = bits_per_value; + strm.block_size = ccsds_block_size; + strm.rsi = ccsds_rsi; -strm.next_in = buf; -strm.avail_in = buflen; + strm.next_in = buf; + strm.avail_in = buflen; bits8 = ((bits_per_value + 7) / 8) * 8; size = n_vals * ((bits_per_value + 7) / 8); @@ -576,9 +575,9 @@ strm.avail_in = buflen; __PRETTY_FUNCTION__, err, aec_get_error_message(err)); err = GRIB_ENCODING_ERROR; goto cleanup; -} + } -pos = 0; + pos = 0; /* ECC-1427: Performance improvement */ //grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); diff --git a/src/grib_accessor_class_data_raw_packing.cc b/src/grib_accessor_class_data_raw_packing.cc index a574e7fcb..acceae597 100644 --- a/src/grib_accessor_class_data_raw_packing.cc +++ b/src/grib_accessor_class_data_raw_packing.cc @@ -11,7 +11,6 @@ * Enrico Fucile ****************************/ -#include "grib_api_internal.h" #include "grib_api_internal_cpp.h" #define PRE_PROCESSING_NONE 0 diff --git a/src/grib_accessor_class_data_simple_packing.cc b/src/grib_accessor_class_data_simple_packing.cc index 79d855561..672b24b70 100644 --- a/src/grib_accessor_class_data_simple_packing.cc +++ b/src/grib_accessor_class_data_simple_packing.cc @@ -53,7 +53,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -template static int unpack(grib_accessor* a, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); diff --git a/src/grib_accessor_class_gen.cc b/src/grib_accessor_class_gen.cc index d7b36cf0c..8b112c6a8 100644 --- a/src/grib_accessor_class_gen.cc +++ b/src/grib_accessor_class_gen.cc @@ -314,16 +314,6 @@ static int unpack_long(grib_accessor* a, long* v, size_t* len) return GRIB_NOT_IMPLEMENTED; } -template inline T _strtod(const char* val, char** last); -template <> inline float _strtod(const char* val, char** last) { - double v = strtod(val, last); - assert(v <= std::numeric_limits::max()); - return v; -} -template <> inline double _strtod(const char* val, char** last) { - return strtod(val, last); -} - template static int unpack(grib_accessor* a, T* v, size_t* len) { @@ -343,7 +333,6 @@ static int unpack(grib_accessor* a, T* v, size_t* len) char* last = NULL; grib_unpack_string(a, val, &l); - //*v = _strtod(val, &last); *v = strtod(val, &last); if (*last == 0) { /* conversion of string to double worked */ grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name); diff --git a/src/grib_value.cc b/src/grib_value.cc index 7fba5127d..b2c67c9a9 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -12,7 +12,6 @@ * Enrico Fucile * ***************************************************************************/ #include "grib_api_internal_cpp.h" -#include "grib_value.h" #include diff --git a/tests/grib_ecc-1467.cc b/tests/grib_ecc-1467.cc index 4696f73ae..879e20191 100644 --- a/tests/grib_ecc-1467.cc +++ b/tests/grib_ecc-1467.cc @@ -51,8 +51,8 @@ int main(int argc, char** argv) fvalues = (float*)malloc(values_len * sizeof(float)); dvalues = (double*)malloc(values_len * sizeof(double)); - CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); CODES_CHECK(codes_get_float_array(h, "values", fvalues, &values_len), 0); + CODES_CHECK(codes_get_double_array(h, "values", dvalues, &values_len), 0); for (i = 0; i < values_len; i++) { abs_error = fabs(dvalues[i] - (double)fvalues[i]); From f2fd35c7eb1c333676da4902e4fbecab12c5e333 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Mar 2023 13:03:49 +0000 Subject: [PATCH 147/212] ECC-1542: Assertion failure: Reduced Gaussian grid with zeros in its pl array --- ...ccessor_class_number_of_points_gaussian.cc | 5 ++++ tests/grib_global.sh | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/grib_accessor_class_number_of_points_gaussian.cc b/src/grib_accessor_class_number_of_points_gaussian.cc index e343eeb3a..7eb2d371e 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/grib_accessor_class_number_of_points_gaussian.cc @@ -327,6 +327,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) if ((ret = grib_get_long_internal(h, self->support_legacy, &support_legacy)) != GRIB_SUCCESS) return ret; + if (support_legacy == 1) return unpack_long_with_legacy_support(a, val, len); else @@ -415,6 +416,10 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) *val = 0; for (j = 0; j < nj; j++) { row_count = 0; + if (pl[j] == 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Invalid pl array: entry at index=%d is zero", j); + return GRIB_GEOCALCULUS_PROBLEM; + } grib_get_reduced_row_wrapper(h, pl[j], lon_first, lon_last, &row_count, &ilon_first, &ilon_last); lon_first_row = ((ilon_first)*360.0) / pl[j]; lon_last_row = ((ilon_last)*360.0) / pl[j]; diff --git a/tests/grib_global.sh b/tests/grib_global.sh index c62b616e8..338aa0b42 100755 --- a/tests/grib_global.sh +++ b/tests/grib_global.sh @@ -9,6 +9,8 @@ . ./include.ctest.sh +label="grib_global_test" + # Check Gaussian grids files_global=" reduced_gaussian_lsm.grib1 @@ -49,3 +51,27 @@ for gg in $files_subarea; do filepath=${data_dir}/$gg grib_check_key_equals $filepath "global" 0 done + + +# ECC-1542 +# Invalid pl array in a Gaussian grid +sample1=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib1.tmpl +sample2=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl +tempGrib=temp.$label.grib +tempText=temp.$label.txt +# Insert a zero into the pl array +${tools_dir}/grib_filter -o $tempGrib - $sample2 < $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid pl array: entry at index=3 is zero" $tempText + +# Clean up +rm -f $tempGrib $tempText From 7325895530d1285e6c8e1c66af8dc74bff73e9d4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Mar 2023 13:21:32 +0000 Subject: [PATCH 148/212] ECC-1542: Assertion failure: Reduced Gaussian grid with zeros in its pl array --- ...ccessor_class_number_of_points_gaussian.cc | 4 ++++ tests/grib_global.sh | 20 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/grib_accessor_class_number_of_points_gaussian.cc b/src/grib_accessor_class_number_of_points_gaussian.cc index 7eb2d371e..f3ee3d169 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/grib_accessor_class_number_of_points_gaussian.cc @@ -540,6 +540,10 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* #if EFDEBUG printf("-- %d ", j); #endif + if (pl[j] == 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, "Invalid pl array: entry at index=%d is zero", j); + return GRIB_GEOCALCULUS_PROBLEM; + } grib_get_reduced_row_wrapper(h, pl[j], lon_first, lon_last, &row_count, &ilon_first, &ilon_last); #if 0 if ( row_count != pl[j] ) { diff --git a/tests/grib_global.sh b/tests/grib_global.sh index 338aa0b42..bc2705fb1 100755 --- a/tests/grib_global.sh +++ b/tests/grib_global.sh @@ -53,19 +53,22 @@ for gg in $files_subarea; do done -# ECC-1542 -# Invalid pl array in a Gaussian grid +# ECC-1542: Invalid pl array in a Gaussian grid +# ----------------------------------------------- sample1=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib1.tmpl sample2=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl tempGrib=temp.$label.grib tempText=temp.$label.txt +tempFilt=temp.$label.filt + # Insert a zero into the pl array -${tools_dir}/grib_filter -o $tempGrib - $sample2 < $tempFilt < $tempText 2>&1 status=$? @@ -73,5 +76,14 @@ set -e [ $status -ne 0 ] grep -q "Invalid pl array: entry at index=3 is zero" $tempText +${tools_dir}/grib_filter -o $tempGrib $tempFilt $sample1 +set +e +${tools_dir}/grib_get -l 0,0 $tempGrib > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid pl array: entry at index=3 is zero" $tempText + + # Clean up -rm -f $tempGrib $tempText +rm -f $tempGrib $tempText $tempFilt From ce21dea187410fccc208b5cf457aa1738113abf3 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Mar 2023 13:53:52 +0000 Subject: [PATCH 149/212] ECC-1542: Fix tests --- src/grib_nearest_class_reduced.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/grib_nearest_class_reduced.cc b/src/grib_nearest_class_reduced.cc index 6a0777be7..b100e57c1 100644 --- a/src/grib_nearest_class_reduced.cc +++ b/src/grib_nearest_class_reduced.cc @@ -135,13 +135,16 @@ static int find_global(grib_nearest* nearest, grib_handle* h, double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); -static int is_legacy(grib_handle* h) +static int is_legacy(grib_handle* h, int* legacy) { - long is_legacy = 0; - return (grib_get_long(h, "legacyGaussSubarea", &is_legacy) == GRIB_SUCCESS && is_legacy == 1); + int err = 0; + long lLegacy = 0; + err = grib_get_long(h, "legacyGaussSubarea", &lLegacy); + if (err) return err; + *legacy = (int)lLegacy; + return GRIB_SUCCESS; } - static int find(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags, double* outlats, double* outlons, double* values, @@ -198,7 +201,8 @@ static int find_global(grib_nearest* nearest, grib_handle* h, get_reduced_row_proc get_reduced_row_func = &grib_get_reduced_row; if (self->legacy == -1 || (flags & GRIB_NEAREST_SAME_GRID) == 0) { - self->legacy = is_legacy(h); + ret = is_legacy(h, &(self->legacy)); + if (ret) return ret; } if (self->legacy == 1) { get_reduced_row_func = &grib_get_reduced_row_legacy; From 730aa7b90b2417d47d518e44815e4cb3d95fe7ef Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Mar 2023 17:25:21 +0000 Subject: [PATCH 150/212] Refactoring --- ...ccessor_class_number_of_points_gaussian.cc | 90 +++++++++---------- src/grib_nearest_class_reduced.cc | 54 +++++------ 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/grib_accessor_class_number_of_points_gaussian.cc b/src/grib_accessor_class_number_of_points_gaussian.cc index f3ee3d169..29e06c009 100644 --- a/src/grib_accessor_class_number_of_points_gaussian.cc +++ b/src/grib_accessor_class_number_of_points_gaussian.cc @@ -320,13 +320,13 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len); static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret = GRIB_SUCCESS; + int err = GRIB_SUCCESS; long support_legacy = 1; grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; grib_handle* h = grib_handle_of_accessor(a); - if ((ret = grib_get_long_internal(h, self->support_legacy, &support_legacy)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->support_legacy, &support_legacy)) != GRIB_SUCCESS) + return err; if (support_legacy == 1) return unpack_long_with_legacy_support(a, val, len); @@ -337,7 +337,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) /* New algorithm */ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) { - int ret = GRIB_SUCCESS; + int err = GRIB_SUCCESS; int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; size_t plsize = 0; @@ -353,14 +353,14 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; grib_context* c = a->context; - if ((ret = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) + return err; - if ((ret = grib_get_long_internal(h, self->nj, &nj)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->nj, &nj)) != GRIB_SUCCESS) + return err; - if ((ret = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) + return err; if (nj == 0) return GRIB_GEOCALCULUS_PROBLEM; @@ -376,19 +376,19 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) double lon_first_row = 0, lon_last_row = 0; /*reduced*/ - if ((ret = grib_get_long_internal(h, self->order, &order)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lat_first, &lat_first)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lon_first, &lon_first)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lat_last, &lat_last)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->order, &order)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lat_first, &lat_first)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lon_first, &lon_first)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lat_last, &lat_last)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) + return err; pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); plsave = pl; @@ -442,13 +442,13 @@ static int unpack_long_new(grib_accessor* a, long* val, size_t* len) if (plsave) grib_context_free(c, plsave); - return ret; + return err; } /* With Legacy support */ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* len) { - int ret = GRIB_SUCCESS; + int err = GRIB_SUCCESS; int is_global = 0; long ni = 0, nj = 0, plpresent = 0, order = 0; size_t plsize = 0; @@ -465,14 +465,14 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* grib_accessor_number_of_points_gaussian* self = (grib_accessor_number_of_points_gaussian*)a; grib_context* c = a->context; - if ((ret = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->ni, &ni)) != GRIB_SUCCESS) + return err; - if ((ret = grib_get_long_internal(h, self->nj, &nj)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->nj, &nj)) != GRIB_SUCCESS) + return err; - if ((ret = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->plpresent, &plpresent)) != GRIB_SUCCESS) + return err; if (nj == 0) return GRIB_GEOCALCULUS_PROBLEM; @@ -488,19 +488,19 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* double lon_first_row = 0, lon_last_row = 0; /*reduced*/ - if ((ret = grib_get_long_internal(h, self->order, &order)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lat_first, &lat_first)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lon_first, &lon_first)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lat_last, &lat_last)) != GRIB_SUCCESS) - return ret; - if ((ret = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) - return ret; - - if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_internal(h, self->order, &order)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lat_first, &lat_first)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lon_first, &lon_first)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lat_last, &lat_last)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double_internal(h, self->lon_last, &lon_last)) != GRIB_SUCCESS) + return err; + + if ((err = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) + return err; pl = (long*)grib_context_malloc_clear(c, sizeof(long) * plsize); plsave = pl; @@ -594,5 +594,5 @@ static int unpack_long_with_legacy_support(grib_accessor* a, long* val, size_t* } } - return ret; + return err; } diff --git a/src/grib_nearest_class_reduced.cc b/src/grib_nearest_class_reduced.cc index b100e57c1..9556149c9 100644 --- a/src/grib_nearest_class_reduced.cc +++ b/src/grib_nearest_class_reduced.cc @@ -108,20 +108,20 @@ static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) return GRIB_OUT_OF_MEMORY; grib_get_long(h, "global", &self->global); if (!self->global) { - int ret; + int err; /*TODO longitudeOfFirstGridPointInDegrees from the def file*/ - if ((ret = grib_get_double(h, "longitudeOfFirstGridPointInDegrees", &self->lon_first)) != GRIB_SUCCESS) { + if ((err = grib_get_double(h, "longitudeOfFirstGridPointInDegrees", &self->lon_first)) != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_reduced: Unable to get longitudeOfFirstGridPointInDegrees %s\n", - grib_get_error_message(ret)); - return ret; + grib_get_error_message(err)); + return err; } /*TODO longitudeOfLastGridPointInDegrees from the def file*/ - if ((ret = grib_get_double(h, "longitudeOfLastGridPointInDegrees", &self->lon_last)) != GRIB_SUCCESS) { + if ((err = grib_get_double(h, "longitudeOfLastGridPointInDegrees", &self->lon_last)) != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_reduced: Unable to get longitudeOfLastGridPointInDegrees %s\n", - grib_get_error_message(ret)); - return ret; + grib_get_error_message(err)); + return err; } } @@ -189,7 +189,7 @@ static int find_global(grib_nearest* nearest, grib_handle* h, double* distances, int* indexes, size_t* len) { grib_nearest_reduced* self = (grib_nearest_reduced*)nearest; - int ret = 0, kk = 0, ii = 0; + int err = 0, kk = 0, ii = 0; size_t jj = 0; long* pla = NULL; long* pl = NULL; @@ -201,19 +201,19 @@ static int find_global(grib_nearest* nearest, grib_handle* h, get_reduced_row_proc get_reduced_row_func = &grib_get_reduced_row; if (self->legacy == -1 || (flags & GRIB_NEAREST_SAME_GRID) == 0) { - ret = is_legacy(h, &(self->legacy)); - if (ret) return ret; + err = is_legacy(h, &(self->legacy)); + if (err) return err; } if (self->legacy == 1) { get_reduced_row_func = &grib_get_reduced_row_legacy; } - if ((ret = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_size(h, self->values_key, &nvalues)) != GRIB_SUCCESS) + return err; nearest->values_count = nvalues; - if ((ret = grib_nearest_get_radius(h, &radiusInKm)) != GRIB_SUCCESS) - return ret; + if ((err = grib_nearest_get_radius(h, &radiusInKm)) != GRIB_SUCCESS) + return err; /* Compute lat/lon info, create iterator etc if it's the 1st time or different grid. * This is for performance: if the grid has not changed, we only do this once @@ -224,13 +224,13 @@ static int find_global(grib_nearest* nearest, grib_handle* h, ilat = 0; ilon = 0; - if (grib_is_missing(h, self->Nj, &ret)) { + if (grib_is_missing(h, self->Nj, &err)) { grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", self->Nj); - return ret ? ret : GRIB_GEOCALCULUS_PROBLEM; + return err ? err : GRIB_GEOCALCULUS_PROBLEM; } - if ((ret = grib_get_long(h, self->Nj, &n)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long(h, self->Nj, &n)) != GRIB_SUCCESS) + return err; self->lats_count = n; if (self->lats) @@ -247,10 +247,10 @@ static int find_global(grib_nearest* nearest, grib_handle* h, if (!self->lons) return GRIB_OUT_OF_MEMORY; - iter = grib_iterator_new(h, GRIB_GEOITERATOR_NO_VALUES, &ret); - if (ret != GRIB_SUCCESS) { + iter = grib_iterator_new(h, GRIB_GEOITERATOR_NO_VALUES, &err); + if (err != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_reduced: Unable to create lat/lon iterator"); - return ret; + return err; } while (grib_iterator_next(iter, &lat, &lon, NULL)) { if (olat != lat) { @@ -311,13 +311,13 @@ static int find_global(grib_nearest* nearest, grib_handle* h, &(self->j[0]), &(self->j[1])); plsize = self->lats_count; - if ((ret = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_size(h, self->pl, &plsize)) != GRIB_SUCCESS) + return err; pla = (long*)grib_context_malloc(h->context, plsize * sizeof(long)); if (!pla) return GRIB_OUT_OF_MEMORY; - if ((ret = grib_get_long_array(h, self->pl, pla, &plsize)) != GRIB_SUCCESS) - return ret; + if ((err = grib_get_long_array(h, self->pl, pla, &plsize)) != GRIB_SUCCESS) + return err; pl = pla; while ((*pl) == 0) { @@ -475,8 +475,8 @@ static int find_global(grib_nearest* nearest, grib_handle* h, if (values) { /* See ECC-1403 and ECC-499 */ /* Performance: Decode the field once and get all 4 values */ - ret = grib_get_double_element_set(h, self->values_key, self->k, NUM_NEIGHBOURS, values); - if (ret != GRIB_SUCCESS) return ret; + err = grib_get_double_element_set(h, self->values_key, self->k, NUM_NEIGHBOURS, values); + if (err != GRIB_SUCCESS) return err; } for (jj = 0; jj < 2; jj++) { for (ii = 0; ii < 2; ii++) { From 4e1bdb1d231cfa739f6f7d9bd96e84a205f23faf Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Mar 2023 17:33:22 +0000 Subject: [PATCH 151/212] Refactoring --- src/grib_accessor_class_g2level.cc | 34 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/grib_accessor_class_g2level.cc b/src/grib_accessor_class_g2level.cc index 18b0bcad7..4b3d081a0 100644 --- a/src/grib_accessor_class_g2level.cc +++ b/src/grib_accessor_class_g2level.cc @@ -143,12 +143,13 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_g2level* self = (grib_accessor_g2level*)a; + grib_handle* hand = grib_handle_of_accessor(a); int n = 0; - self->type_first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->scale_first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->value_first = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->pressure_units = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); + self->type_first = grib_arguments_get_name(hand, c, n++); + self->scale_first = grib_arguments_get_name(hand, c, n++); + self->value_first = grib_arguments_get_name(hand, c, n++); + self->pressure_units = grib_arguments_get_name(hand, c, n++); } static void dump(grib_accessor* a, grib_dumper* dumper) @@ -160,6 +161,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) { int ret = 0; grib_accessor_g2level* self = (grib_accessor_g2level*)a; + grib_handle* hand = grib_handle_of_accessor(a); long type_first = 0; long scale_first = 0; @@ -169,13 +171,13 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) double v; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->type_first, &type_first)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->type_first, &type_first)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->scale_first, &scale_first)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->scale_first, &scale_first)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->value_first, &value_first)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->value_first, &value_first)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_string_internal(grib_handle_of_accessor(a), self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) + if ((ret = grib_get_string_internal(hand, self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) return ret; if (value_first == GRIB_MISSING_LONG) { @@ -213,7 +215,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) // Switch to Pa instead of hPa as the value is less than a hectoPascal char pa[] = "Pa"; size_t lpa = strlen(pa); - if ((ret = grib_set_string_internal(grib_handle_of_accessor(a), self->pressure_units, pa, &lpa)) != GRIB_SUCCESS) + if ((ret = grib_set_string_internal(hand, self->pressure_units, pa, &lpa)) != GRIB_SUCCESS) return ret; } else { @@ -241,6 +243,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) static int pack_double(grib_accessor* a, const double* val, size_t* len) { grib_accessor_g2level* self = (grib_accessor_g2level*)a; + grib_handle* hand = grib_handle_of_accessor(a); int ret = 0; double value_first = *val; long scale_first = 0; @@ -251,10 +254,10 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if (*len != 1) return GRIB_WRONG_ARRAY_SIZE; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->type_first, &type_first)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(hand, self->type_first, &type_first)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_string_internal(grib_handle_of_accessor(a), self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) + if ((ret = grib_get_string_internal(hand, self->pressure_units, pressure_units, &pressure_units_len)) != GRIB_SUCCESS) return ret; switch (type_first) { @@ -277,9 +280,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) value_first = value_first + 0.5; /* round up */ if (type_first > 9) { - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->scale_first, scale_first)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->scale_first, scale_first)) != GRIB_SUCCESS) return ret; - if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->value_first, (long)value_first)) != GRIB_SUCCESS) + if ((ret = grib_set_long_internal(hand, self->value_first, (long)value_first)) != GRIB_SUCCESS) return ret; } @@ -363,10 +366,11 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) static int is_missing(grib_accessor* a) { grib_accessor_g2level* self = (grib_accessor_g2level*)a; + grib_handle* hand = grib_handle_of_accessor(a); int err = 0; int ret = 0; - ret = grib_is_missing(grib_handle_of_accessor(a), self->scale_first, &err) + - grib_is_missing(grib_handle_of_accessor(a), self->value_first, &err); + ret = grib_is_missing(hand, self->scale_first, &err) + + grib_is_missing(hand, self->value_first, &err); return ret; } From ec4b67896b63895c934807687378f3af4811d3d0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 11 Mar 2023 13:23:26 +0000 Subject: [PATCH 152/212] ECC-1545: GRIB2: Deletion of parameter definitions --- definitions/grib2/cfVarName.def | 6 ------ definitions/grib2/localConcepts/kwbc/name.def | 6 ------ definitions/grib2/localConcepts/kwbc/paramId.def | 6 ------ definitions/grib2/localConcepts/kwbc/shortName.def | 6 ------ definitions/grib2/localConcepts/kwbc/units.def | 6 ------ definitions/grib2/name.def | 6 ------ definitions/grib2/paramId.def | 6 ------ definitions/grib2/shortName.def | 6 ------ definitions/grib2/units.def | 6 ------ 9 files changed, 54 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 27aedbe25..9a56ba0dc 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -5572,12 +5572,6 @@ parameterCategory = 1 ; parameterNumber = 40 ; } -#Potential evaporation rate -'pevpr' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 41 ; - } #Snow cover 'snowc' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/kwbc/name.def b/definitions/grib2/localConcepts/kwbc/name.def index b3bd218b1..3afad81b8 100644 --- a/definitions/grib2/localConcepts/kwbc/name.def +++ b/definitions/grib2/localConcepts/kwbc/name.def @@ -65,12 +65,6 @@ parameterCategory = 1 ; parameterNumber = 199 ; } -#Potential evaporation rate -'Potential evaporation rate' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 200 ; - } #Snow cover 'Snow cover' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/kwbc/paramId.def b/definitions/grib2/localConcepts/kwbc/paramId.def index 485f8288f..02115d105 100644 --- a/definitions/grib2/localConcepts/kwbc/paramId.def +++ b/definitions/grib2/localConcepts/kwbc/paramId.def @@ -65,12 +65,6 @@ parameterCategory = 1 ; parameterNumber = 199 ; } -#Potential evaporation rate -'260037' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 200 ; - } #Snow cover '260038' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/kwbc/shortName.def b/definitions/grib2/localConcepts/kwbc/shortName.def index 833599f6d..5e9f0732c 100644 --- a/definitions/grib2/localConcepts/kwbc/shortName.def +++ b/definitions/grib2/localConcepts/kwbc/shortName.def @@ -65,12 +65,6 @@ parameterCategory = 1 ; parameterNumber = 199 ; } -#Potential evaporation rate -'pevpr' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 200 ; - } #Snow cover 'snowc' = { discipline = 0 ; diff --git a/definitions/grib2/localConcepts/kwbc/units.def b/definitions/grib2/localConcepts/kwbc/units.def index 149cb6c3f..e322ed2ad 100644 --- a/definitions/grib2/localConcepts/kwbc/units.def +++ b/definitions/grib2/localConcepts/kwbc/units.def @@ -65,12 +65,6 @@ parameterCategory = 1 ; parameterNumber = 199 ; } -#Potential evaporation rate -'W m**-2' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 200 ; - } #Snow cover '%' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 52dc0489c..57d05eaa1 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -5572,12 +5572,6 @@ parameterCategory = 1 ; parameterNumber = 40 ; } -#Potential evaporation rate -'Potential evaporation rate' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 41 ; - } #Snow cover 'Snow cover' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 6eeb64341..29593dfa6 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -5572,12 +5572,6 @@ parameterCategory = 1 ; parameterNumber = 40 ; } -#Potential evaporation rate -'260037' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 41 ; - } #Snow cover '260038' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index cd5a31566..72ae448d7 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -5572,12 +5572,6 @@ parameterCategory = 1 ; parameterNumber = 40 ; } -#Potential evaporation rate -'pevpr' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 41 ; - } #Snow cover 'snowc' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 833208e24..b2a4cfc80 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -5572,12 +5572,6 @@ parameterCategory = 1 ; parameterNumber = 40 ; } -#Potential evaporation rate -'W m**-2' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 41 ; - } #Snow cover '%' = { discipline = 0 ; From 98119fab48a9c9ef8c86a58baf503c045210123f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 11 Mar 2023 17:28:50 +0000 Subject: [PATCH 153/212] ECC-1543: GRIB2: New parameter encodings for DestinationEarth --- definitions/grib2/cfVarName.def | 15 +++++++++++++++ definitions/grib2/name.def | 15 +++++++++++++++ definitions/grib2/paramId.def | 15 +++++++++++++++ definitions/grib2/shortName.def | 15 +++++++++++++++ definitions/grib2/units.def | 15 +++++++++++++++ 5 files changed, 75 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 9a56ba0dc..86de6b70c 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -2453,6 +2453,21 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Potential evaporation rate +'pevr' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + } +#Potential evaporation +'peva' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean temperature tendency due to short-wave radiation 'mttswr' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 57d05eaa1..cf4e24aa2 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -2453,6 +2453,21 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Potential evaporation rate +'Potential evaporation rate' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + } +#Potential evaporation +'Potential evaporation' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean temperature tendency due to short-wave radiation 'Mean temperature tendency due to short-wave radiation' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 29593dfa6..5835d5fe6 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -2453,6 +2453,21 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Potential evaporation rate +'231004' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + } +#Potential evaporation +'231005' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean temperature tendency due to short-wave radiation '235001' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 72ae448d7..586f68332 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -2453,6 +2453,21 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Potential evaporation rate +'pevr' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + } +#Potential evaporation +'peva' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean temperature tendency due to short-wave radiation 'mttswr' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index b2a4cfc80..af49b45bc 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -2453,6 +2453,21 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Potential evaporation rate +'kg m**-2 s**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + } +#Potential evaporation +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 143 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Mean temperature tendency due to short-wave radiation 'K s**-1' = { discipline = 0 ; From 704745ab5b638502a52f9ed52c61c8a0f3714195 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 12 Mar 2023 14:52:13 +0000 Subject: [PATCH 154/212] Compiler warnings: format specifies type 'int' but the argument has type 'long' [-Werror,-Wformat] --- src/grib_accessor_class_bufr_data_array.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grib_accessor_class_bufr_data_array.cc b/src/grib_accessor_class_bufr_data_array.cc index 546950e7e..13e77da38 100644 --- a/src/grib_accessor_class_bufr_data_array.cc +++ b/src/grib_accessor_class_bufr_data_array.cc @@ -855,7 +855,7 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu grib_set_bits_on(buff->data, pos, modifiedWidth); } else { - grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s (%06d). Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", + grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s (%06ld). Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", bd->shortName, bd->code, *v, minAllowed, maxAllowed); return GRIB_OUT_OF_RANGE; /* ECC-611 */ } @@ -947,12 +947,12 @@ static int encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bu v++; } if (max > maxAllowed && max != GRIB_MISSING_DOUBLE) { - grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s (%06d). Maximum value (value[%lu]=%g) out of range (maxAllowed=%g).", + grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s (%06ld). Maximum value (value[%lu]=%g) out of range (maxAllowed=%g).", bd->shortName, bd->code, index_of_max, max, maxAllowed); return GRIB_OUT_OF_RANGE; } if (min < minAllowed && min != GRIB_MISSING_DOUBLE) { - grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s (%06d). Minimum value (value[%lu]=%g) out of range (minAllowed=%g).", + grib_context_log(c, GRIB_LOG_ERROR, "encode_double_array: %s (%06ld). Minimum value (value[%lu]=%g) out of range (minAllowed=%g).", bd->shortName, bd->code, index_of_min, min, minAllowed); return GRIB_OUT_OF_RANGE; } @@ -1044,7 +1044,7 @@ static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bu grib_set_bits_on(buff->data, pos, modifiedWidth); } else { - grib_context_log(c, GRIB_LOG_ERROR, "encode_double_value: %s (%06d). Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", + grib_context_log(c, GRIB_LOG_ERROR, "encode_double_value: %s (%06ld). Value (%g) out of range (minAllowed=%g, maxAllowed=%g).", bd->shortName, bd->code, value, minAllowed, maxAllowed); return GRIB_OUT_OF_RANGE; } From e411d10cc32515b46d7e8a520d82641210c9a32c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 12 Mar 2023 19:24:14 +0000 Subject: [PATCH 155/212] Better error messages --- src/grib_parse_utils.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/grib_parse_utils.cc b/src/grib_parse_utils.cc index 11c5aabf8..93d4ce50d 100644 --- a/src/grib_parse_utils.cc +++ b/src/grib_parse_utils.cc @@ -108,7 +108,8 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una snprintf(val, sizeof(val), "undef"); } else { - grib_context_log(h->context, GRIB_LOG_WARNING, "grib_recompose_name: Problem to recompose filename with : %s ( %s no accessor found)", uname, loc); + grib_context_log(h->context, GRIB_LOG_WARNING, + "Recompose name: Problem recomposing filename with : %s ( %s no accessor found)", uname, loc); return GRIB_NOT_FOUND; } } @@ -129,14 +130,15 @@ int grib_recompose_name(grib_handle* h, grib_accessor* observer, const char* una snprintf(val, sizeof(val), "%d", (int)lval); break; default: - grib_context_log(h->context, GRIB_LOG_WARNING, "grib_recompose_name: Problem to recompose filename with : %s, invalid type %d", loc, type); + grib_context_log(h->context, GRIB_LOG_WARNING, + "Recompose name: Problem recomposing filename with %s, invalid type %d", loc, type); break; } grib_dependency_add(observer, a); if ((ret != GRIB_SUCCESS)) { - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_recompose_name: Could not recompose filename : %s", uname); + grib_context_log(h->context, GRIB_LOG_ERROR, "Recompose name: Could not recompose filename: %s", uname); return ret; } } @@ -420,7 +422,7 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha break; default: grib_context_log(h->context, GRIB_LOG_WARNING, - "grib_accessor_print: Problem printing \"%s\", invalid type %d", a->name, grib_get_type_name(type)); + "Accessor print: Problem printing \"%s\", invalid type %d", a->name, grib_get_type_name(type)); } return ret; } @@ -496,7 +498,8 @@ int grib_recompose_print(grib_handle* h, grib_accessor* observer, const char* un ret = GRIB_NOT_FOUND; } else { - grib_context_log(h->context, GRIB_LOG_WARNING, "grib_recompose_print: Problem to recompose print with : %s, no accessor found", loc); + grib_context_log(h->context, GRIB_LOG_WARNING, + "Recompose print: Problem recomposing print with : %s, no accessor found", loc); return GRIB_NOT_FOUND; } } @@ -623,7 +626,7 @@ char* file_being_parsed() int grib_yyerror(const char* msg) { grib_context_log(grib_parser_context, GRIB_LOG_ERROR, - "grib_parser: %s at line %d of %s", msg, grib_yylineno + 1, parse_file); + "Parser: %s at line %d of %s", msg, grib_yylineno + 1, parse_file); grib_context_log(grib_parser_context, GRIB_LOG_ERROR, "ecCodes Version: %s", ECCODES_VERSION_STR); error = 1; @@ -658,7 +661,7 @@ void grib_parser_include(const char* included_fname) grib_parser_context->grib_definition_files_path); grib_context_log(grib_parser_context, GRIB_LOG_FATAL, - "grib_parser_include: Could not resolve '%s' (included in %s)", included_fname, parse_file); + "Parser include: Could not resolve '%s' (included in %s)", included_fname, parse_file); return; } @@ -678,7 +681,7 @@ void grib_parser_include(const char* included_fname) if (f == NULL) { char buffer[1024]; - grib_context_log(grib_parser_context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "grib_parser_include: cannot open: '%s'", parse_file); + grib_context_log(grib_parser_context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), "Parser include: cannot open: '%s'", parse_file); snprintf(buffer, sizeof(buffer), "Cannot include file: '%s'", parse_file); grib_yyerror(buffer); } From 766259a2b17d256befa9562617e78320625fed79 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 11:21:24 +0000 Subject: [PATCH 156/212] GRIB2: Add templates 4.62 and 4.63 (Thanks to Robert Osinski) --- definitions/grib2/template.4.62.def | 10 ++++++++++ definitions/grib2/template.4.63.def | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 definitions/grib2/template.4.62.def create mode 100644 definitions/grib2/template.4.63.def diff --git a/definitions/grib2/template.4.62.def b/definitions/grib2/template.4.62.def new file mode 100644 index 000000000..53da724c4 --- /dev/null +++ b/definitions/grib2/template.4.62.def @@ -0,0 +1,10 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.62, Average, accumulation, and/or extreme values or other statistically processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles at a horizontal level or horizontal layer at a point in time + +include "grib2/template.4.parameter.def" +include "grib2/template.4.tile.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.statistical.def" diff --git a/definitions/grib2/template.4.63.def b/definitions/grib2/template.4.63.def new file mode 100644 index 000000000..2b0396795 --- /dev/null +++ b/definitions/grib2/template.4.63.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.63, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for spatio-temporal changing tiles + +include "grib2/template.4.parameter.def" +include "grib2/template.4.tile.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.eps.def" +include "grib2/template.4.statistical.def" From b892ff1017427ea6b0f170228b7e639035e2f24a Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 13 Mar 2023 11:47:39 +0000 Subject: [PATCH 157/212] ECC-1467: Fixed data run length class --- src/grib_accessor_class_data_run_length_packing.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/grib_accessor_class_data_run_length_packing.cc index 55b46f0b9..d8ecdaba2 100644 --- a/src/grib_accessor_class_data_run_length_packing.cc +++ b/src/grib_accessor_class_data_run_length_packing.cc @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_data_run_length_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -105,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_data_run_length_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,6 +132,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -143,7 +149,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; From ce053e1bdc6c00e35c1dbfbd26c8ce7b9f8fad62 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 13 Mar 2023 11:47:39 +0000 Subject: [PATCH 158/212] ECC-1467: Fixed data run length class --- src/grib_accessor_class_data_run_length_packing.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/grib_accessor_class_data_run_length_packing.cc index 55b46f0b9..d8ecdaba2 100644 --- a/src/grib_accessor_class_data_run_length_packing.cc +++ b/src/grib_accessor_class_data_run_length_packing.cc @@ -89,7 +89,9 @@ static grib_accessor_class _grib_accessor_class_data_run_length_packing = { 0, /* grib_pack procedures long */ 0, /* grib_unpack procedures long */ &pack_double, /* grib_pack procedures double */ + 0, /* grib_pack procedures float */ &unpack_double, /* grib_unpack procedures double */ + 0, /* grib_unpack procedures float */ 0, /* grib_pack procedures string */ 0, /* grib_unpack procedures string */ 0, /* grib_pack array procedures string */ @@ -105,7 +107,9 @@ static grib_accessor_class _grib_accessor_class_data_run_length_packing = { 0, /* next accessor */ 0, /* compare vs. another accessor */ 0, /* unpack only ith value */ + 0, /* unpack only ith value */ 0, /* unpack a given set of elements */ + 0, /* unpack a given set of elements */ 0, /* unpack a subarray */ 0, /* clear */ 0, /* clone accessor */ @@ -128,6 +132,8 @@ static void init_class(grib_accessor_class* c) c->is_missing = (*(c->super))->is_missing; c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; + c->pack_float = (*(c->super))->pack_float; + c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; @@ -143,7 +149,9 @@ static void init_class(grib_accessor_class* c) c->next = (*(c->super))->next; c->compare = (*(c->super))->compare; c->unpack_double_element = (*(c->super))->unpack_double_element; + c->unpack_float_element = (*(c->super))->unpack_float_element; c->unpack_double_element_set = (*(c->super))->unpack_double_element_set; + c->unpack_float_element_set = (*(c->super))->unpack_float_element_set; c->unpack_double_subarray = (*(c->super))->unpack_double_subarray; c->clear = (*(c->super))->clear; c->make_clone = (*(c->super))->make_clone; From 659c7b995b677d1444f06a2484dab44b446424ff Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 12:04:46 +0000 Subject: [PATCH 159/212] ECC-1547: GRIB2: Changing PDTN from rectangular to circular cluster fails --- .../grib2/template.4.circular_cluster.def | 18 ++++++++---------- .../grib2/template.4.rectangular_cluster.def | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/definitions/grib2/template.4.circular_cluster.def b/definitions/grib2/template.4.circular_cluster.def index 7db252798..f6e2cade4 100644 --- a/definitions/grib2/template.4.circular_cluster.def +++ b/definitions/grib2/template.4.circular_cluster.def @@ -5,43 +5,41 @@ unsigned[1] clusterIdentifier : dump; alias number=clusterIdentifier; # Number of cluster to which the high resolution control belongs -unsigned[1] numberOfClusterHighResolution : dump; +unsigned[1] numberOfClusterHighResolution : dump; # Number of cluster to which the low resolution control belongs -unsigned[1] numberOfClusterLowResolution : dump; +unsigned[1] numberOfClusterLowResolution : dump; # Total number of clusters -unsigned[1] totalNumberOfClusters : dump; +unsigned[1] totalNumberOfClusters : dump; alias totalNumber=totalNumberOfClusters; # Clustering method codetable[1] clusteringMethod ('4.8.table',masterDir,localDir) : dump; # Latitude of central point in cluster domain -unsigned[4] latitudeOfCentralPointInClusterDomain : dump; +unsigned[4] latitudeOfCentralPointInClusterDomain : dump; # Longitude of central point in cluster domain -unsigned[4] longitudeOfCentralPointInClusterDomain : dump; +unsigned[4] longitudeOfCentralPointInClusterDomain : dump; # Radius of cluster domain unsigned[4] radiusOfClusterDomain : dump ; # NC - Number of forecasts in the cluster -unsigned[1] numberOfForecastsInTheCluster : dump; +unsigned[1] numberOfForecastsInTheCluster : dump; alias NC = numberOfForecastsInTheCluster; # Scale factor of standard deviation in the cluster unsigned[1] scaleFactorOfStandardDeviation : edition_specific ; alias scaleFactorOfStandardDeviationInTheCluster=scaleFactorOfStandardDeviation; - # Scaled value of standard deviation in the cluster unsigned[4] scaledValueOfStandardDeviation : dump ; alias scaledValueOfStandardDeviationInTheCluster=scaledValueOfStandardDeviation; - # Scale factor of distance of the cluster from ensemble mean -unsigned[1] scaleFactorOfDistanceFromEnsembleMean : dump; +unsigned[1] scaleFactorOfDistanceFromEnsembleMean : dump; # Scaled value of distance of the cluster from ensemble mean -unsigned[4] scaleFactorOfDistanceFromEnsembleMean : dump; +unsigned[4] scaledValueOfDistanceFromEnsembleMean : dump; diff --git a/definitions/grib2/template.4.rectangular_cluster.def b/definitions/grib2/template.4.rectangular_cluster.def index 4d1208658..1d4f359f8 100644 --- a/definitions/grib2/template.4.rectangular_cluster.def +++ b/definitions/grib2/template.4.rectangular_cluster.def @@ -47,4 +47,3 @@ unsigned[1] scaleFactorOfDistanceFromEnsembleMean : dump ; # Scaled value of distance of the cluster from ensemble mean unsigned[4] scaledValueOfDistanceFromEnsembleMean : dump ; - From 97a007a4a226311ff17755ee185eb2325a8ff7a8 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Mon, 13 Mar 2023 12:32:36 +0000 Subject: [PATCH 160/212] ECC-1467: Use __func__ in log messages --- src/grib_accessor_class_data_apply_bitmap.cc | 4 ++-- src/grib_accessor_class_data_ccsds_packing.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/grib_accessor_class_data_apply_bitmap.cc b/src/grib_accessor_class_data_apply_bitmap.cc index 5ba13e1a4..4711e7215 100644 --- a/src/grib_accessor_class_data_apply_bitmap.cc +++ b/src/grib_accessor_class_data_apply_bitmap.cc @@ -435,7 +435,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) grib_context_log(a->context, GRIB_LOG_DEBUG, "grib_accessor_class_data_apply_bitmap: %s : creating %s, %d values", - __PRETTY_FUNCTION__, + __func__, a->name, n_vals); for (i = 0; i < n_vals; i++) { @@ -449,7 +449,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_class_data_apply_bitmap [%s]:" " %s : number of coded values does not match bitmap %ld %ld", - a->name, __PRETTY_FUNCTION__, coded_n_vals, n_vals); + a->name, __func__, coded_n_vals, n_vals); return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 45d644836..af46ea401 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -573,7 +573,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) if ((err = aec_buffer_decode(&strm)) != AEC_OK) { grib_context_log(a->context, GRIB_LOG_ERROR, "CCSDS %s: aec_buffer_decode error %d (%s)\n", - __PRETTY_FUNCTION__, err, aec_get_error_message(err)); + __func__, err, aec_get_error_message(err)); err = GRIB_ENCODING_ERROR; goto cleanup; } From 04290932918a0b78be36cadd468b46fd982caddf Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 14:28:35 +0000 Subject: [PATCH 161/212] Fix comments --- src/grib_accessor_class_data_g22order_packing.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index db54646ee..fb44f8ef9 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -533,12 +533,11 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) return err; - /*if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err;/* - /* Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: - * 0 Row by row splitting - * 1 General group splitting - * We only support General group splitting - */ + //if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; + //Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: + // * 0 Row by row splitting + // * 1 General group splitting + // * We only support General group splitting groupSplittingMethodUsed = 1; if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) From f518780f437735322ad3c100fffd48c926e36c2e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 15:44:32 +0000 Subject: [PATCH 162/212] ECC-1467: Fix function overrides --- src/grib_accessor_class_data_apply_bitmap.cc | 1 - src/grib_accessor_class_data_apply_boustrophedonic.cc | 2 +- src/grib_accessor_class_data_complex_packing.cc | 6 ++---- src/grib_accessor_class_data_g22order_packing.cc | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/grib_accessor_class_data_apply_bitmap.cc b/src/grib_accessor_class_data_apply_bitmap.cc index 4711e7215..91686bafc 100644 --- a/src/grib_accessor_class_data_apply_bitmap.cc +++ b/src/grib_accessor_class_data_apply_bitmap.cc @@ -45,7 +45,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int get_native_type(grib_accessor*); static int pack_double(grib_accessor*, const double* val, size_t* len); -template static int unpack(grib_accessor* a, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.cc b/src/grib_accessor_class_data_apply_boustrophedonic.cc index d1f2bbfbd..1f642c8d0 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/grib_accessor_class_data_apply_boustrophedonic.cc @@ -18,6 +18,7 @@ SUPER = grib_accessor_class_gen IMPLEMENTS = init IMPLEMENTS = unpack_double;unpack_double_element;unpack_double_element_set + IMPLEMENTS = unpack_float IMPLEMENTS = pack_double IMPLEMENTS = value_count IMPLEMENTS = dump;get_native_type @@ -128,7 +129,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; diff --git a/src/grib_accessor_class_data_complex_packing.cc b/src/grib_accessor_class_data_complex_packing.cc index e10249fed..3b45cb480 100644 --- a/src/grib_accessor_class_data_complex_packing.cc +++ b/src/grib_accessor_class_data_complex_packing.cc @@ -48,16 +48,12 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -template static int unpack(grib_accessor* a, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); static void init(grib_accessor*, const long, grib_arguments*); static void init_class(grib_accessor_class*); -typedef unsigned long (*encode_float_proc)(double); -typedef double (*decode_float_proc)(unsigned long); - typedef struct grib_accessor_data_complex_packing { grib_accessor att; @@ -185,6 +181,8 @@ static void init_class(grib_accessor_class* c) /* END_CLASS_IMP */ +typedef unsigned long (*encode_float_proc)(double); +typedef double (*decode_float_proc)(unsigned long); static void init(grib_accessor* a, const long v, grib_arguments* args) { diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index fb44f8ef9..ae3a6d9e3 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -20,6 +20,7 @@ SUPER = grib_accessor_class_values IMPLEMENTS = init IMPLEMENTS = unpack_double + IMPLEMENTS = unpack_float IMPLEMENTS = pack_double IMPLEMENTS = unpack_double_element;unpack_double_element_set IMPLEMENTS = value_count @@ -58,7 +59,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int pack_double(grib_accessor*, const double* val, size_t* len); -template static int unpack(grib_accessor* a, T* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_float(grib_accessor*, float* val, size_t* len); static int value_count(grib_accessor*, long*); @@ -167,7 +167,6 @@ static void init_class(grib_accessor_class* c) c->pack_long = (*(c->super))->pack_long; c->unpack_long = (*(c->super))->unpack_long; c->pack_float = (*(c->super))->pack_float; - c->unpack_float = (*(c->super))->unpack_float; c->pack_string = (*(c->super))->pack_string; c->unpack_string = (*(c->super))->unpack_string; c->pack_string_array = (*(c->super))->pack_string_array; From 0162b0ca2f63cb546132efda415f75db85ff2232 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 19:57:36 +0000 Subject: [PATCH 163/212] ECC-1467: Tests --- tests/grib_ecc-1467.cc | 20 +++++++++----------- tests/grib_ecc-1467.sh | 16 ++++++---------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/grib_ecc-1467.cc b/tests/grib_ecc-1467.cc index 879e20191..69c5f73e9 100644 --- a/tests/grib_ecc-1467.cc +++ b/tests/grib_ecc-1467.cc @@ -7,25 +7,22 @@ * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include -#include + #include -#undef NDEBUG -#include #include "eccodes.h" #include "grib_api_internal.h" int main(int argc, char** argv) { int err = 0; - float* fvalues = NULL; /* data values as floats */ - double* dvalues = NULL; /* data values as doubles */ + float* fvalues = NULL; // data values as floats + double* dvalues = NULL; // data values as doubles size_t values_len = 0; // number of data points size_t i = 0; double abs_error = 0; - double max_abs_error = 1e-03; - double tolerance = 1e-03; + const double max_abs_error = 1e-03; + const double tolerance = 1e-03; double dmin; double dmax; float fval; @@ -42,10 +39,10 @@ int main(int argc, char** argv) printf("Opening %s\n", filename); in = fopen(filename, "rb"); - assert(in); + Assert(in); h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err); - assert(h); + Assert(h); CODES_CHECK(codes_get_size(h, "values", &values_len), 0); @@ -57,7 +54,8 @@ int main(int argc, char** argv) for (i = 0; i < values_len; i++) { abs_error = fabs(dvalues[i] - (double)fvalues[i]); if (abs_error > max_abs_error) { - fprintf(stderr, "ERROR:\n\tfvalue %e\n\tdvalue %e\n\terror %e\n\tmax_abs_error %e\n", fvalues[i], dvalues[i], abs_error, max_abs_error); + fprintf(stderr, "ERROR:\n\tfvalue %e\n\tdvalue %e\n\terror %e\n\tmax_abs_error %e\n", + fvalues[i], dvalues[i], abs_error, max_abs_error); Assert(!"Absolute error test failed\n"); } diff --git a/tests/grib_ecc-1467.sh b/tests/grib_ecc-1467.sh index b948c771f..e666f7a0d 100755 --- a/tests/grib_ecc-1467.sh +++ b/tests/grib_ecc-1467.sh @@ -10,40 +10,36 @@ . ./include.ctest.sh -# Constant Fields +# Constant fields gfiles="constant_field.grib1" # grid_simple, edition=1 gfiles="$gfiles constant_field.grib2" # grid_simple, edition=2 -# Grid Simple +# Grid simple gfiles="$gfiles sst_globus0083.grib" # grid_simple, edition=1 gfiles="$gfiles reduced_latlon_surface.grib1" # grid_simple, edition=1 gfiles="$gfiles reduced_latlon_surface.grib2" # grid_simple, edition=2 gfiles="$gfiles regular_latlon_surface.grib1" # grid_simple, edition=1 gfiles="$gfiles regular_latlon_surface.grib2" # grid_simple, edition=2 -# Spherical Complex +# Spectral complex gfiles="$gfiles spherical_pressure_level.grib1" # spectral_complex, edition=1 gfiles="$gfiles spherical_pressure_level.grib2" # spectral_complex, edition=2 -# Grid Complex +# Grid complex #gfiles="$gfiles " # grid_complex, edition=1 gfiles="$gfiles gfs.complex.mvmu.grib2" # grid_complex, edition=2, g22order_packing -# Second Order +# Second order gfiles="$gfiles lfpw.grib1" # grid_second_order, edition=1 #gfiles="$gfiles " # grid_second_order, edition=2 # CCSDS if [ $HAVE_AEC -eq 1 ]; then - echo "Adding extra files (HAVE_AEC=1)" gfiles="$gfiles ccsds.grib2" fi for f in $gfiles; do input=${data_dir}/$f - ${tools_dir}/grib_ls -w count=1 -p numberOfDataPoints,numberOfCodedValues,numberOfMissing,avg $input + # ${tools_dir}/grib_ls -w count=1 -p numberOfDataPoints,numberOfCodedValues,numberOfMissing,avg $input $EXEC ${test_dir}/grib_ecc-1467 $input done - - - From 01df9f9cd66503d81990fb3cd0f086e78887e06f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 20:19:37 +0000 Subject: [PATCH 164/212] ECC-1467: Refactor --- src/grib_accessor_class_bitmap.cc | 5 ++-- src/grib_accessor_class_bitmap.h | 39 ------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 src/grib_accessor_class_bitmap.h diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc index b0d49661f..b5b9023eb 100644 --- a/src/grib_accessor_class_bitmap.cc +++ b/src/grib_accessor_class_bitmap.cc @@ -8,7 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_accessor_class_bitmap.h" +#include "grib_api_internal.h" + /* This is used by make_class.pl @@ -262,7 +263,7 @@ int unpack(grib_accessor* a, T* val, size_t* len) return err; if (*len < tlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %ld values", a->name, tlen); *len = 0; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/grib_accessor_class_bitmap.h b/src/grib_accessor_class_bitmap.h deleted file mode 100644 index f1ea63c6a..000000000 --- a/src/grib_accessor_class_bitmap.h +++ /dev/null @@ -1,39 +0,0 @@ -// ECC-1467 - -#pragma once - -#include "grib_api_internal_cpp.h" -#include - -template -class GribAccessorClassBitmap { -public: - static int unpack(grib_accessor* a, T* val, size_t* len); -}; - -template -int GribAccessorClassBitmap::unpack(grib_accessor* a, T* val, size_t* len) -{ - static_assert(std::is_floating_point::value, "Requires floating points numbers"); - long pos = a->offset * 8; - long tlen; - long i; - int err = 0; - grib_handle* hand = grib_handle_of_accessor(a); - - err = grib_value_count(a, &tlen); - if (err) - return err; - - if (*len < tlen) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %ld values", a->name, tlen); - *len = 0; - return GRIB_ARRAY_TOO_SMALL; - } - - for (i = 0; i < tlen; i++) { - val[i] = (T)grib_decode_unsigned_long(hand->buffer->data, &pos, 1); - } - *len = tlen; - return GRIB_SUCCESS; -} From 6be97f8c84b4d71b68d3f2556451b9936ee8bd25 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 13 Mar 2023 20:24:30 +0000 Subject: [PATCH 165/212] C++: Need header file for is_floating_point --- src/grib_accessor_class_bitmap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/grib_accessor_class_bitmap.cc b/src/grib_accessor_class_bitmap.cc index b5b9023eb..5a16b0ef1 100644 --- a/src/grib_accessor_class_bitmap.cc +++ b/src/grib_accessor_class_bitmap.cc @@ -9,6 +9,7 @@ */ #include "grib_api_internal.h" +#include /* This is used by make_class.pl From f16f625f5c14ec04fda899f7b34e63f4e489fb70 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 14 Mar 2023 14:37:42 +0000 Subject: [PATCH 166/212] ECC-1550: GRIB2: Incorrect product definition conversion from 48 to 46 --- ...rib_accessor_class_select_step_template.cc | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/grib_accessor_class_select_step_template.cc b/src/grib_accessor_class_select_step_template.cc index 2da747dcd..2bc744419 100644 --- a/src/grib_accessor_class_select_step_template.cc +++ b/src/grib_accessor_class_select_step_template.cc @@ -174,8 +174,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + // DET = deterministic i.e., not ensemble + // ENS = ensemble system if (self->instant) { - /* Going from continuous or non-continuous interval to a point-in-time (instantaneous) */ + // Going from continuous or non-continuous interval to a point-in-time (instantaneous) switch (productDefinitionTemplateNumber) { case 8: productDefinitionTemplateNumberNew = 0; @@ -198,28 +200,28 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) case 14: productDefinitionTemplateNumberNew = 4; break; - case 42: /* non-EPS chemical */ + case 42: // DET chemical productDefinitionTemplateNumberNew = 40; break; - case 43: /* EPS chemical */ + case 43: // ENS chemical productDefinitionTemplateNumberNew = 41; break; - case 46: /* non-EPS aerosol */ - productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + case 46: // DET aerosol + productDefinitionTemplateNumberNew = 48; // 44 is deprecated break; - case 47: /* EPS aerosol */ + case 47: // ENS aerosol productDefinitionTemplateNumberNew = 45; break; - case 67: /* non-EPS chemical distrib func */ + case 67: // DET chemical distrib func productDefinitionTemplateNumberNew = 57; break; - case 68: /* EPS chemical distrib func */ + case 68: // ENS chemical distrib func productDefinitionTemplateNumberNew = 58; break; - case 72: /* non-EPS post-processing */ + case 72: // DET post-processing productDefinitionTemplateNumberNew = 70; break; - case 73: /* EPS post-processing */ + case 73: // ENS post-processing */ productDefinitionTemplateNumberNew = 71; break; case 0: @@ -239,7 +241,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } else { - /* Going from point-in-time (instantaneous) to continuous or non-continuous interval */ + // Going from point-in-time (instantaneous) to continuous or non-continuous interval switch (productDefinitionTemplateNumber) { case 0: productDefinitionTemplateNumberNew = 8; @@ -262,29 +264,25 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) case 6: productDefinitionTemplateNumberNew = 10; break; - case 40: /* non-EPS chemical */ + case 40: // DET chemical productDefinitionTemplateNumberNew = 42; break; - case 41: /* EPS chemical */ + case 41: // ENS chemical productDefinitionTemplateNumberNew = 43; break; - case 48: /* non-EPS aerosol. Note template 44 is deprecated */ - productDefinitionTemplateNumberNew = 46; + case 45: // ENS aerosol + productDefinitionTemplateNumberNew = 85; // 47 is deprecated break; - case 45: /* EPS aerosol */ - /*productDefinitionTemplateNumberNew = 47; PDT deprecated */ - productDefinitionTemplateNumberNew = 85; - break; - case 57: /* non-EPS chemical distrib func */ + case 57: // DET chemical distrib func productDefinitionTemplateNumberNew = 67; break; - case 58: /* EPS chemical distrib func */ + case 58: // ENS chemical distrib func productDefinitionTemplateNumberNew = 68; break; - case 70: /* non-EPS post-processing */ + case 70: // DET post-processing productDefinitionTemplateNumberNew = 72; break; - case 71: /* EPS post-processing */ + case 71: // ENS post-processing productDefinitionTemplateNumberNew = 73; break; case 7: From b25643aa990e9e159380123b35dba45d8d430a0d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 14 Mar 2023 14:42:41 +0000 Subject: [PATCH 167/212] ECC-1550: GRIB2: Incorrect product definition conversion from 48 to 46 --- ...rib_accessor_class_select_step_template.cc | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/grib_accessor_class_select_step_template.cc b/src/grib_accessor_class_select_step_template.cc index 2bc744419..a3ddb88fe 100644 --- a/src/grib_accessor_class_select_step_template.cc +++ b/src/grib_accessor_class_select_step_template.cc @@ -8,12 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" + /* This is used by make_class.pl @@ -154,10 +150,11 @@ static void init_class(grib_accessor_class* c) static void init(grib_accessor* a, const long l, grib_arguments* c) { grib_accessor_select_step_template* self = (grib_accessor_select_step_template*)a; - int n = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int n = 0; - self->productDefinitionTemplateNumber = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); - self->instant = grib_arguments_get_long(grib_handle_of_accessor(a), c, n++); + self->productDefinitionTemplateNumber = grib_arguments_get_name(hand, c, n++); + self->instant = grib_arguments_get_long(hand, c, n++); } static int unpack_long(grib_accessor* a, long* val, size_t* len) @@ -169,10 +166,11 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) static int pack_long(grib_accessor* a, const long* val, size_t* len) { grib_accessor_select_step_template* self = (grib_accessor_select_step_template*)a; + grib_handle* hand = grib_handle_of_accessor(a); long productDefinitionTemplateNumber = 0; long productDefinitionTemplateNumberNew = 0; - grib_get_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); + grib_get_long(hand, self->productDefinitionTemplateNumber, &productDefinitionTemplateNumber); // DET = deterministic i.e., not ensemble // ENS = ensemble system @@ -301,10 +299,11 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } - if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) - grib_set_long(grib_handle_of_accessor(a), self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); + if (productDefinitionTemplateNumber != productDefinitionTemplateNumberNew) { + grib_set_long(hand, self->productDefinitionTemplateNumber, productDefinitionTemplateNumberNew); + } - return 0; + return GRIB_SUCCESS; } static int value_count(grib_accessor* a, long* c) From be4b84a293c76cddf35545186067972ec332f0ff Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 14 Mar 2023 14:53:43 +0000 Subject: [PATCH 168/212] Migration to C++ --- src/grib_accessor_class_data_ccsds_packing.cc | 49 ++++++------ src/grib_accessor_class_g2_eps.cc | 20 ++--- src/grib_accessor_class_local_definition.cc | 78 +++++++++---------- 3 files changed, 70 insertions(+), 77 deletions(-) diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index af46ea401..a28afa6cc 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -274,7 +274,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) return err; - /* Special case */ + // Special case if (*len == 0) { grib_buffer_replace(a, NULL, 0, 1, 1); return GRIB_SUCCESS; @@ -295,8 +295,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) is_constant_field = true; } else { if (bits_per_value == 0) { - /* ECC-1202: A non-constant field with bitsPerValue==0! */ - bits_per_value = 24; /* Set sane value */ + // ECC-1202: A non-constant field with bitsPerValue==0! + bits_per_value = 24; // Set sane value } } @@ -316,7 +316,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if ((err = grib_set_long_internal(hand, self->number_of_values, n_vals)) != GRIB_SUCCESS) return err; - bits_per_value = 0; /* ECC-1387 */ + bits_per_value = 0; // ECC-1387 if ((err = grib_set_long_internal(hand, self->bits_per_value, bits_per_value)) != GRIB_SUCCESS) return err; @@ -347,7 +347,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } } else { - int last = 127; /* last must be a parameter coming from the def file*/ + int last = 127; // last must be a parameter coming from the def file double range = 0; double minrange = 0, maxrange = 0; double unscaled_max = 0; @@ -407,11 +407,11 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) buflen++; } } - /* buflen = n_vals*(bits_per_value/8);*/ + // buflen = n_vals*(bits_per_value/8); grib_context_log(a->context, GRIB_LOG_DEBUG,"CCSDS pack_double: packing %s, %d values", a->name, n_vals); - /*ECC-1431: GRIB2: CCSDS encoding failure AEC_STREAM_ERROR*/ + // ECC-1431: GRIB2: CCSDS encoding failure AEC_STREAM_ERROR buflen += buflen / 20 + 256; buf = (unsigned char*)grib_context_buffer_malloc_clear(a->context, buflen); @@ -423,7 +423,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if ((err = grib_set_double_internal(hand, self->reference_value, reference_value)) != GRIB_SUCCESS) return err; { - /* Make sure we can decode it again */ + // Make sure we can decode it again double ref = 1e-100; grib_get_double_internal(hand, self->reference_value, &ref); Assert(ref == reference_value); @@ -445,10 +445,9 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) strm.next_in = encoded; strm.avail_in = bits8 / 8 * n_vals; - /* - This does not support spherical harmonics, and treats 24 differently than: - see http://cdo.sourcearchive.com/documentation/1.5.1.dfsg.1-1/cgribexlib_8c_source.html - */ + // This does not support spherical harmonics, and treats 24 differently than: + // see http://cdo.sourcearchive.com/documentation/1.5.1.dfsg.1-1/cgribexlib_8c_source.html + if (hand->context->debug) print_aec_stream_info(&strm, "pack_double"); if ((err = aec_buffer_encode(&strm)) != AEC_OK) { @@ -458,10 +457,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) goto cleanup; } - /* - printf("n_vals = %ld, bits8 = %ld\n", n_vals, bits8); - printf("in %ld out => %zu\n", bits8/8*n_vals, buflen); - */ + //printf("n_vals = %ld, bits8 = %ld\n", n_vals, bits8); + //printf("in %ld out => %zu\n", bits8/8*n_vals, buflen); buflen = strm.total_out; grib_buffer_replace(a, buf, buflen, 1, 1); @@ -494,7 +491,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) size_t n_vals = 0; size_t size = 0; unsigned char* decoded = NULL; - /*unsigned char* p = NULL;*/ + // unsigned char* p = NULL; long pos = 0; long nn = 0; @@ -523,7 +520,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) if ((err = grib_get_long_internal(hand, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ + // ECC-477: Don't call grib_get_long_internal to suppress error message being output if ((err = grib_get_long(hand, self->ccsds_flags, &ccsds_flags)) != GRIB_SUCCESS) return err; @@ -532,11 +529,11 @@ static int unpack(grib_accessor* a, T* val, size_t* len) if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) return err; - /* TODO: This should be called upstream */ + // TODO: This should be called upstream if (*len < n_vals) return GRIB_ARRAY_TOO_SMALL; - /* Special case */ + // Special case if (bits_per_value == 0) { for (i = 0; i < n_vals; i++) val[i] = reference_value; @@ -580,8 +577,8 @@ static int unpack(grib_accessor* a, T* val, size_t* len) pos = 0; -/* ECC-1427: Performance improvement */ -//grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); + // ECC-1427: Performance improvement + //grib_decode_float_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); grib_decode_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val); *len = n_vals; @@ -602,7 +599,7 @@ static int unpack_float(grib_accessor* a, float* val, size_t* len) static int unpack_double_element(grib_accessor* a, size_t idx, double* val) { - /* The index idx relates to codedValues NOT values! */ + // The index idx relates to codedValues NOT values! grib_accessor_data_ccsds_packing* self = (grib_accessor_data_ccsds_packing*)a; grib_handle* hand = grib_handle_of_accessor(a); int err = 0; @@ -616,7 +613,7 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val) if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - /* Special case of constant field */ + // Special case of constant field if (bits_per_value == 0) { *val = reference_value; return GRIB_SUCCESS; @@ -652,7 +649,7 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array if ((err = grib_get_double_internal(hand, self->reference_value, &reference_value)) != GRIB_SUCCESS) return err; - /* Special case of constant field */ + // Special case of constant field if (bits_per_value == 0) { for (i = 0; i < len; i++) { val_array[i] = reference_value; @@ -660,7 +657,7 @@ static int unpack_double_element_set(grib_accessor* a, const size_t* index_array return GRIB_SUCCESS; } - /* GRIB-564: The indexes in index_array relate to codedValues NOT values! */ + // GRIB-564: The indexes in index_array relate to codedValues NOT values! err = grib_get_size(grib_handle_of_accessor(a), "codedValues", &size); if (err) return err; diff --git a/src/grib_accessor_class_g2_eps.cc b/src/grib_accessor_class_g2_eps.cc index e75665fc6..949d4bc25 100644 --- a/src/grib_accessor_class_g2_eps.cc +++ b/src/grib_accessor_class_g2_eps.cc @@ -8,12 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" + /* This is used by make_class.pl @@ -220,10 +216,10 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) return GRIB_ENCODING_ERROR; } - /* eps or stream=(enda or elda or ewla) */ + // eps or stream=(enda or elda or ewla) if (eps || stream == 1030 || stream == 1249 || stream == 1250) { if (isInstant) { - /* type=em || type=es */ + // type=em || type=es if (type == 17) { productDefinitionTemplateNumberNew = 2; derivedForecast = 0; @@ -237,7 +233,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } else { - /* type=em || type=es */ + // type=em || type=es if (type == 17) { productDefinitionTemplateNumberNew = 12; derivedForecast = 0; @@ -260,7 +256,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } - /* Adjust for chemical species */ + // Adjust for chemical species if (chemical == 1) { if (eps == 1) { if (isInstant) { @@ -280,20 +276,20 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } - /* Adjust for aerosols */ + // Adjust for aerosols if (aerosol == 1) { if (eps == 1) { if (isInstant) { productDefinitionTemplateNumberNew = 45; } else { - /*productDefinitionTemplateNumberNew = 47; This PDT is deprecated */ + //productDefinitionTemplateNumberNew = 47; This PDT is deprecated productDefinitionTemplateNumberNew = 85; } } else { if (isInstant) { - productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + productDefinitionTemplateNumberNew = 48; //44 is deprecated*/ } else { productDefinitionTemplateNumberNew = 46; diff --git a/src/grib_accessor_class_local_definition.cc b/src/grib_accessor_class_local_definition.cc index aca91e460..e1dc84f16 100644 --- a/src/grib_accessor_class_local_definition.cc +++ b/src/grib_accessor_class_local_definition.cc @@ -258,12 +258,12 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) productDefinitionTemplateNumberNew = 0; break; - case 1: /* MARS labelling */ - case 36: /* MARS labelling for long window 4Dvar system */ - case 40: /* MARS labeling with domain and model (for LAM) */ - case 42: /* LC-WFV: Wave forecast verification */ + case 1: // MARS labelling + case 36: // MARS labelling for long window 4Dvar system + case 40: // MARS labeling with domain and model (for LAM) + case 42: // LC-WFV: Wave forecast verification if (isInstant) { - /* type=em || type=es */ + // type=em || type=es if (type == 17) { productDefinitionTemplateNumberNew = 2; derivedForecast = 0; @@ -271,7 +271,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) else if (type == 18) { productDefinitionTemplateNumberNew = 2; derivedForecast = 4; - /* eps or enda or elda or ewla */ + // eps or enda or elda or ewla } else if (eps == 1 || stream == 1030 || stream == 1249 || stream == 1250) { productDefinitionTemplateNumberNew = 1; @@ -281,7 +281,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } else { - /* type=em || type=es */ + // type=em || type=es if (type == 17) { productDefinitionTemplateNumberNew = 12; derivedForecast = 0; @@ -289,7 +289,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) else if (type == 18) { productDefinitionTemplateNumberNew = 12; derivedForecast = 4; - /* eps or enda or elda or ewla */ + // eps or enda or elda or ewla } else if (eps == 1 || stream == 1030 || stream == 1249 || stream == 1250) { productDefinitionTemplateNumberNew = 11; @@ -299,7 +299,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } break; - case 41: /* EFAS: uses post-processing templates */ + case 41: // EFAS: uses post-processing templates if (isInstant) { if (eps == 1) productDefinitionTemplateNumberNew = 71; @@ -307,7 +307,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) productDefinitionTemplateNumberNew = 70; } else { - /* non-instantaneous: accum etc */ + // non-instantaneous: accum etc if (eps == 1) productDefinitionTemplateNumberNew = 73; else @@ -315,12 +315,12 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } break; - case 15: /* Seasonal forecast data */ - case 16: /* Seasonal forecast monthly mean data */ - case 12: /* Seasonal forecast monthly mean data for lagged systems */ - case 18: /* Multianalysis ensemble data */ - case 26: /* MARS labelling or ensemble forecast data */ - case 30: /* Forecasting Systems with Variable Resolution */ + case 15: // Seasonal forecast data + case 16: // Seasonal forecast monthly mean data + case 12: // Seasonal forecast monthly mean data for lagged systems + case 18: // Multianalysis ensemble data + case 26: // MARS labelling or ensemble forecast data + case 30: // Forecasting Systems with Variable Resolution if (isInstant) { productDefinitionTemplateNumberNew = 1; } @@ -329,21 +329,21 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } break; - case 5: /* Forecast probability data */ - case 7: /* Sensitivity data */ - case 9: /* Singular vectors and ensemble perturbations */ - case 11: /* Supplementary data used by the analysis */ - case 14: /* Brightness temperature */ - case 20: /* 4D variational increments */ - case 21: /* Sensitive area predictions */ - case 23: /* Coupled atmospheric, wave and ocean means */ - case 24: /* Satellite Channel Number Data */ + case 5: // Forecast probability data + case 7: // Sensitivity data + case 9: // Singular vectors and ensemble perturbations + case 11: // Supplementary data used by the analysis + case 14: // Brightness temperature + case 20: // 4D variational increments + case 21: // Sensitive area predictions + case 23: // Coupled atmospheric, wave and ocean means + case 24: // Satellite Channel Number Data case 25: - case 28: /* COSMO local area EPS */ - case 38: /* 4D variational increments for long window 4Dvar system */ - case 39: /* 4DVar model errors for long window 4Dvar system */ - case 60: /* Ocean data analysis */ - case 192: /* Multiple ECMWF local definitions */ + case 28: // COSMO local area EPS + case 38: // 4D variational increments for long window 4Dvar system + case 39: // 4DVar model errors for long window 4Dvar system + case 60: // Ocean data analysis + case 192: // Multiple ECMWF local definitions if (isInstant) { productDefinitionTemplateNumberNew = 0; } @@ -354,17 +354,17 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) default: #ifdef DEBUG - /* In test & development mode, fail so we remember to adjust PDTN */ + // In test & development mode, fail so we remember to adjust PDTN grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_local_definition: Invalid localDefinitionNumber %d", localDefinitionNumber); return GRIB_ENCODING_ERROR; #endif - /* ECC-1253: Do not fail in operations. Leave PDTN as is */ + // ECC-1253: Do not fail in operations. Leave PDTN as is productDefinitionTemplateNumberNew = productDefinitionTemplateNumber; break; } - /* Adjust for atmospheric chemical constituents */ + // Adjust for atmospheric chemical constituents if (chemical == 1) { if (eps == 1) { if (isInstant) { @@ -383,7 +383,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } } - /* Adjust for atmospheric chemical constituents based on a distribution function */ + // Adjust for atmospheric chemical constituents based on a distribution function if (chemical_distfn == 1) { if (eps == 1) { if (isInstant) { @@ -403,7 +403,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } - /* Adjust for atmospheric chemical constituents with source or sink */ + // Adjust for atmospheric chemical constituents with source or sink if (chemical_srcsink == 1) { if (eps == 1) { if (isInstant) { @@ -423,27 +423,27 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) } } - /* Adjust for aerosols */ + // Adjust for aerosols if (aerosol == 1) { if (eps == 1) { if (isInstant) { productDefinitionTemplateNumberNew = 45; } else { - /*productDefinitionTemplateNumberNew = 47; This PDT is deprecated */ + //productDefinitionTemplateNumberNew = 47; This PDT is deprecated productDefinitionTemplateNumberNew = 85; } } else { if (isInstant) { - productDefinitionTemplateNumberNew = 48; /*44 is deprecated*/ + productDefinitionTemplateNumberNew = 48; //44 is deprecated*/ } else { productDefinitionTemplateNumberNew = 46; } } } - /* Adjust for optical properties of aerosol */ + // Adjust for optical properties of aerosol if (aerosol_optical == 1) { if (eps == 1) { if (isInstant) { From 889f7dfda3ecd5800410f5449430349ccb39cc05 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 14 Mar 2023 15:35:33 +0000 Subject: [PATCH 169/212] Tools: Print failure reason (printing key values) --- tools/grib_tools.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index 66cee8089..d5990ec16 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -1048,7 +1048,7 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type if (ret == GRIB_NOT_FOUND) { snprintf(value_str, 32, "not_found"); } else { - fprintf(dump_file, "ERROR: Failed to get value for key %s\n", key_name); + fprintf(dump_file, "ERROR: Failed to get value for key %s (%s)\n", key_name, grib_get_error_message(ret)); exit(1); } } From 07cd7242b7565b758777fd7ef4575290b3e85c4f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 14 Mar 2023 16:11:54 +0000 Subject: [PATCH 170/212] ECC-1549: GRIB2: New parameter encodings for upcoming tile templates --- definitions/grib2/cfVarName.def | 12 ++++++++++++ definitions/grib2/name.def | 12 ++++++++++++ definitions/grib2/paramId.def | 12 ++++++++++++ definitions/grib2/shortName.def | 12 ++++++++++++ definitions/grib2/units.def | 12 ++++++++++++ 5 files changed, 60 insertions(+) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 86de6b70c..41a071d57 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -2468,6 +2468,18 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Tile fraction +'tifr' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 36 ; + } +#Tile percentage +'tipe' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } #Mean temperature tendency due to short-wave radiation 'mttswr' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index cf4e24aa2..a149ebdeb 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -2468,6 +2468,18 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Tile fraction +'Tile fraction' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 36 ; + } +#Tile percentage +'Tile percentage' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } #Mean temperature tendency due to short-wave radiation 'Mean temperature tendency due to short-wave radiation' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 5835d5fe6..7990000eb 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -2468,6 +2468,18 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Tile fraction +'231006' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 36 ; + } +#Tile percentage +'231007' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } #Mean temperature tendency due to short-wave radiation '235001' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 586f68332..13da2dbe5 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -2468,6 +2468,18 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Tile fraction +'tifr' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 36 ; + } +#Tile percentage +'tipe' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } #Mean temperature tendency due to short-wave radiation 'mttswr' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index af49b45bc..b2bcfb68d 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -2468,6 +2468,18 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Tile fraction +'Proportion' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 36 ; + } +#Tile percentage +'%' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } #Mean temperature tendency due to short-wave radiation 'K s**-1' = { discipline = 0 ; From 1c905d7cd39f8be98bc6e64a02050aaba4aa1737 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 14 Mar 2023 21:09:57 +0000 Subject: [PATCH 171/212] ECC-1551: grib_get: Error message does not include the offending key --- tests/grib_get_fail.sh | 19 +++++++++++++++---- tools/grib_tools.cc | 20 ++++++++++++++------ 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/tests/grib_get_fail.sh b/tests/grib_get_fail.sh index 369469b6e..9f34e83b8 100755 --- a/tests/grib_get_fail.sh +++ b/tests/grib_get_fail.sh @@ -10,6 +10,8 @@ . ./include.ctest.sh +label="grib_get_fail_test" +tempText=temp.$label.txt REDIRECT=/dev/null # Check input file has been downloaded @@ -17,9 +19,18 @@ REDIRECT=/dev/null # Expect failure as the key does not exist set +e -${tools_dir}/grib_get -p gribname ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT - +${tools_dir}/grib_get -p boomerang ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT if [ $? -eq 0 ] ; then - # Should not have succeeded - exit 1; + exit 1; # Should not have succeeded fi +set -e + +# ECC-1551: Print which key does not exist +set +e +${tools_dir}/grib_get -p Ni,Nh,Nj $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Nh (Key/value not found)" $tempText + +rm -f $tempText diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index d5990ec16..8b6becee7 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -1048,7 +1048,9 @@ static void get_value_for_key(grib_handle* h, const char* key_name, int key_type if (ret == GRIB_NOT_FOUND) { snprintf(value_str, 32, "not_found"); } else { - fprintf(dump_file, "ERROR: Failed to get value for key %s (%s)\n", key_name, grib_get_error_message(ret)); + fprintf(dump_file, "ERROR: Failed to get value for key '%s' (%s)\n", key_name, grib_get_error_message(ret)); + if (ret == GRIB_ARRAY_TOO_SMALL) + fprintf(dump_file, "\tHint: Tool %s cannot print keys of array type. Use grib_filter.\n", tool_name); exit(1); } } @@ -1205,12 +1207,18 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h) } if (ret != GRIB_SUCCESS) { - if (options->fail) - GRIB_CHECK_NOLINE(ret, options->print_keys[i].name); - if (ret == GRIB_NOT_FOUND) + if (options->fail) { // ECC-1551 + //GRIB_CHECK_NOLINE(ret, options->print_keys[i].name); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s (%s)", + options->print_keys[i].name, grib_get_error_message(ret)); + exit(ret); + } + if (ret == GRIB_NOT_FOUND) { strcpy(value, notfound); - else { - fprintf(dump_file, "%s %s\n", grib_get_error_message(ret), options->print_keys[i].name); + } else { + fprintf(dump_file, "%s (%s)\n", options->print_keys[i].name, grib_get_error_message(ret)); + if (ret == GRIB_ARRAY_TOO_SMALL) + fprintf(dump_file, "\tHint: Tool %s cannot print keys of array type. Use grib_filter.\n", tool_name); exit(ret); } } From 20513f079d776d1127a411484c9b624b62499264 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 15 Mar 2023 12:52:06 +0000 Subject: [PATCH 172/212] ECC-1467: Fortran single-precision --- fortran/grib_fortran.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index f8a3fc08a..e3ce24556 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -2761,36 +2761,20 @@ int grib_f_get_real4(int* gid, char* key, float* val, int len){ return grib_f_get_real4_( gid, key, val, len); } -int grib_f_get_real4_array_(int* gid, char* key, float *val, int* size, int len) +int grib_f_get_real4_array_(int* gid, char* key, float *val, int* size, int len) { grib_handle *h = get_handle(*gid); int err = GRIB_SUCCESS; char buf[1024]; size_t lsize = *size; - double* val8 = NULL; - size_t i; - - if(!h) return GRIB_INVALID_GRIB; - - if(*size) - val8 = (double*)grib_context_malloc(h->context,(*size)*(sizeof(double))); - else - val8 = (double*)grib_context_malloc(h->context,sizeof(double)); - if(!val8) return GRIB_OUT_OF_MEMORY; - - err = grib_get_double_array(h, cast_char(buf,key,len), val8, &lsize); - if (err) { - grib_context_free(h->context,val8); - return err; + if(!h){ + return GRIB_INVALID_GRIB; + }else{ + err = grib_get_float_array(h, cast_char(buf,key,len), val, &lsize); + *size = lsize; + return err; } - - for(i=0;icontext,val8); - - return err; } int grib_f_get_real4_array__(int* gid, char* key, float* val, int* size, int len){ return grib_f_get_real4_array_( gid, key, val, size, len); @@ -2800,7 +2784,7 @@ int grib_f_get_real4_array(int* gid, char* key, float* val, int* size, int len){ } /*****************************************************************************/ -int grib_f_set_force_real4_array_(int* gid, char* key, float*val, int* size, int len) +int grib_f_set_force_real4_array_(int* gid, char* key, float* val, int* size, int len) { grib_handle *h = get_handle(*gid); int err = GRIB_SUCCESS; From 6f28d660e66a52a393cf5a9f2493bd2c2613e0da Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 15 Mar 2023 13:42:27 +0000 Subject: [PATCH 173/212] ECC:1467: Fixing test: eccodes_f_grib_get_pv --- examples/F90/grib_get_pv.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/F90/grib_get_pv.f90 b/examples/F90/grib_get_pv.f90 index eda580ffa..a7201846d 100644 --- a/examples/F90/grib_get_pv.f90 +++ b/examples/F90/grib_get_pv.f90 @@ -16,7 +16,7 @@ program grib_get_pv integer :: infile integer :: igrib integer :: PVPresent, nb_pv - real, dimension(:), allocatable :: pv + real(kind=8), dimension(:), allocatable :: pv call codes_open_file(infile, '../../data/reduced_gaussian_model_level.grib1', 'r') From 5bf0168e616a025d2e66581def18308006e6f086 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Mar 2023 14:45:59 +0000 Subject: [PATCH 174/212] Examples: Be explicit in type specification (double precision) --- examples/F90/grib_get_pv.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/F90/grib_get_pv.f90 b/examples/F90/grib_get_pv.f90 index eda580ffa..f22d9805f 100644 --- a/examples/F90/grib_get_pv.f90 +++ b/examples/F90/grib_get_pv.f90 @@ -16,12 +16,12 @@ program grib_get_pv integer :: infile integer :: igrib integer :: PVPresent, nb_pv - real, dimension(:), allocatable :: pv + real(8), dimension(:), allocatable :: pv call codes_open_file(infile, '../../data/reduced_gaussian_model_level.grib1', 'r') - ! A new grib message is loaded from file - ! igrib is the grib id to be used in subsequent calls + ! A new GRIB message is loaded from file + ! igrib is the message id to be used in subsequent calls call codes_grib_new_from_file(infile, igrib) ! Get PVPresent to see if the 'pv' array is there From e2231ac6e1bd92331b43a5e4772cdc3550ce57eb Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Mar 2023 14:58:41 +0000 Subject: [PATCH 175/212] CMake: Better naming --- examples/F90/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 11087151c..dd52ca843 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -97,24 +97,24 @@ else() get_product_kind ) endif() -foreach( tool ${tests_sanity} ) - ecbuild_add_test( TARGET eccodes_f_${tool} - SOURCES ${tool}.f90 +foreach( atest ${tests_sanity} ) + ecbuild_add_test( TARGET eccodes_f_${atest} + SOURCES ${atest}.f90 LINKER_LANGUAGE Fortran LIBS eccodes_f90 eccodes CONDITION HAVE_FORTRAN LABELS "sanity" RESOURCES bufr_read_scatterometer_f.ref - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh ) + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${atest}.sh ) endforeach() -foreach( tool ${tests_extra} ) - ecbuild_add_test( TARGET eccodes_f_${tool} - SOURCES ${tool}.f90 +foreach( atest ${tests_extra} ) + ecbuild_add_test( TARGET eccodes_f_${atest} + SOURCES ${atest}.f90 LINKER_LANGUAGE Fortran LIBS eccodes_f90 eccodes CONDITION HAVE_FORTRAN AND ENABLE_EXTRA_TESTS RESOURCES bufr_read_scatterometer_f.ref - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${atest}.sh TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs eccodes_download_bufr_refs ) endforeach() From e53fa17e693a7d2437b9011a93e0cbca71b43f8c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Mar 2023 14:58:48 +0000 Subject: [PATCH 176/212] Examples: Be explicit in type specification (double precision) --- examples/F90/grib_get_pv.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/F90/grib_get_pv.f90 b/examples/F90/grib_get_pv.f90 index f22d9805f..230d81575 100644 --- a/examples/F90/grib_get_pv.f90 +++ b/examples/F90/grib_get_pv.f90 @@ -16,7 +16,7 @@ program grib_get_pv integer :: infile integer :: igrib integer :: PVPresent, nb_pv - real(8), dimension(:), allocatable :: pv + real(kind=8), dimension(:), allocatable :: pv call codes_open_file(infile, '../../data/reduced_gaussian_model_level.grib1', 'r') From 33d61c45b77db805631892507da62be4b0a31de1 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Mar 2023 18:16:11 +0000 Subject: [PATCH 177/212] Fix comments --- src/grib_accessor_class_data_g22order_packing.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index db54646ee..70776cbfc 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -533,12 +533,12 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) if ((err = grib_get_long_internal(gh, self->typeOfOriginalFieldValues, &typeOfOriginalFieldValues)) != GRIB_SUCCESS) return err; - /*if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err;/* - /* Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: - * 0 Row by row splitting - * 1 General group splitting - * We only support General group splitting - */ + //if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; + // Key groupSplittingMethodUsed uses Code table 5.4 which has two entries: + // 0 Row by row splitting + // 1 General group splitting + // We only support General group splitting + groupSplittingMethodUsed = 1; if ((err = grib_get_long_internal(gh, self->missingValueManagementUsed, &missingValueManagementUsed)) != GRIB_SUCCESS) From c6f0164f93b27eefa9ac96ea887b8a2a50852a4e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 15 Mar 2023 21:18:09 +0000 Subject: [PATCH 178/212] ECC-1552: GRIB: return non empty proj string for unprojected gridded fields --- src/grib_accessor_class_proj_string.cc | 44 ++++++++++++++------------ tests/grib_proj_string.sh | 14 +++++++- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/grib_accessor_class_proj_string.cc b/src/grib_accessor_class_proj_string.cc index 954625bb4..4e02e4cfd 100644 --- a/src/grib_accessor_class_proj_string.cc +++ b/src/grib_accessor_class_proj_string.cc @@ -159,17 +159,17 @@ static int get_native_type(grib_accessor* a) return GRIB_TYPE_STRING; } -/* Function pointer than takes a handle and returns the proj string */ +// Function pointer than takes a handle and returns the proj string typedef int (*proj_func)(grib_handle*, char*); struct proj_mapping { - const char* gridType; /* key gridType */ - proj_func func; /* function to compute proj string */ + const char* gridType; // key gridType + proj_func func; // function to compute proj string }; typedef struct proj_mapping proj_mapping; -/* This should only be called for GRID POINT data (not spherical harmonics etc) */ +// This should only be called for GRID POINT data (not spherical harmonics etc) static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor) { int err = 0; @@ -185,7 +185,7 @@ static int get_major_minor_axes(grib_handle* h, double* pMajor, double* pMinor) return err; } -/* Caller must have allocated enough space in the 'result' argument */ +// Caller must have allocated enough space in the 'result' argument static int get_earth_shape(grib_handle* h, char* result) { int err = 0; @@ -193,22 +193,11 @@ static int get_earth_shape(grib_handle* h, char* result) if ((err = get_major_minor_axes(h, &major, &minor)) != GRIB_SUCCESS) return err; if (major == minor) - snprintf(result, 128, "+R=%lf", major); /* spherical */ + snprintf(result, 128, "+R=%lf", major); // spherical else - snprintf(result, 128, "+a=%lf +b=%lf", major, minor); /*oblate*/ + snprintf(result, 128, "+a=%lf +b=%lf", major, minor); // oblate return err; } -#if 0 -static int proj_regular_latlon(grib_handle* h, char* result) -{ - int err = 0; - char shape[64] = {0,}; - if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) - return err; - snprintf(result, 128, "+proj=latlong %s", shape); - return err; -} -#endif static int proj_space_view(grib_handle* h, char* result) { @@ -305,6 +294,18 @@ static int proj_polar_stereographic(grib_handle* h, char* result) return err; } +// This is for regular_ll, regular_gg, reduced_ll, reduced_gg +static int proj_unprojected(grib_handle* h, char* result) +{ + int err = 0; + char shape[64] = {0,}; + if ((err = get_earth_shape(h, shape)) != GRIB_SUCCESS) + return err; + + snprintf(result, 1024, "+proj=longlat %s", shape); + return err; +} + static int proj_mercator(grib_handle* h, char* result) { int err = 0; @@ -322,7 +323,10 @@ static int proj_mercator(grib_handle* h, char* result) #define NUMBER(a) (sizeof(a) / sizeof(a[0])) static proj_mapping proj_mappings[] = { - /*{ "regular_ll", &proj_regular_latlon },*/ + { "regular_ll", &proj_unprojected }, + { "regular_gg", &proj_unprojected }, + { "reduced_ll", &proj_unprojected }, + { "reduced_gg", &proj_unprojected }, { "mercator", &proj_mercator }, { "lambert", &proj_lambert_conformal }, @@ -358,7 +362,7 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) snprintf(v, 64, "EPSG:4326"); } else { - /* Invoke the appropriate function to get the target proj string */ + // Invoke the appropriate function to get the target proj string if ((err = pm.func(h, v)) != GRIB_SUCCESS) return err; } } diff --git a/tests/grib_proj_string.sh b/tests/grib_proj_string.sh index 676f31492..180333d26 100755 --- a/tests/grib_proj_string.sh +++ b/tests/grib_proj_string.sh @@ -45,7 +45,19 @@ for f in `echo $files`; do fi done -# Various grids +# Various grid types +${tools_dir}/grib_get -p projString $grib2_sample > $tempText +grep -q "proj=longlat" $tempText +${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_ll_pl_grib2.tmpl > $tempText +grep -q "proj=longlat" $tempText +${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_gg_ml_grib1.tmpl > $tempText +grep -q "proj=longlat" $tempText +${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl > $tempText +grep -q "proj=longlat" $tempText +${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl > $tempText +grep -q "proj=longlat" $tempText + + ${tools_dir}/grib_set -s gridType=lambert_azimuthal_equal_area $grib2_sample $tempGrib ${tools_dir}/grib_get -p projString $tempGrib > $tempText grep -q "proj=laea" $tempText From 4f028e7f89a5aa9c619a0d897febf71a4ae67b93 Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Thu, 16 Mar 2023 08:27:07 +0000 Subject: [PATCH 179/212] grib_util_set_spec: gridType=lambert --- src/grib_util.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index fc5057eb9..86f1c4db3 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1184,11 +1184,16 @@ grib_handle* grib_util_set_spec2(grib_handle* h, COPY_SPEC_LONG(Ni); /* same as Nx */ COPY_SPEC_LONG(Nj); /* same as Ny */ - /* - * Note: DxInMetres and DyInMetres - * should be 'double' and not integer. WMO GRIB2 uses millimetres! - * TODO: Add other keys like Latin1, LoV etc - */ + COPY_SPEC_LONG(iScansNegatively); + COPY_SPEC_LONG(jScansPositively); + COPY_SPEC_DOUBLE(latitudeOfSouthernPoleInDegrees); + COPY_SPEC_DOUBLE(longitudeOfSouthernPoleInDegrees); + COPY_SPEC_LONG(uvRelativeToGrid); + + // Note: DxInMetres and DyInMetres + // should be 'double' and not integer. WMO GRIB2 uses millimetres! + // TODO: Add other keys like Latin1, LoV etc + break; case GRIB_UTIL_GRID_SPEC_REDUCED_GG: From 6f28ad0c2ed55b2033a50ae0eed47b617d61a1ae Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Mar 2023 10:13:34 +0000 Subject: [PATCH 180/212] ECC-1552: Improve test --- tests/grib_proj_string.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/grib_proj_string.sh b/tests/grib_proj_string.sh index 180333d26..8400c3004 100755 --- a/tests/grib_proj_string.sh +++ b/tests/grib_proj_string.sh @@ -47,15 +47,15 @@ done # Various grid types ${tools_dir}/grib_get -p projString $grib2_sample > $tempText -grep -q "proj=longlat" $tempText +grep -q "proj=longlat +R=6367470" $tempText ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_ll_pl_grib2.tmpl > $tempText -grep -q "proj=longlat" $tempText +grep -q "proj=longlat +R=6371229" $tempText ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_gg_ml_grib1.tmpl > $tempText -grep -q "proj=longlat" $tempText +grep -q "proj=longlat +R=6367470" $tempText ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl > $tempText -grep -q "proj=longlat" $tempText +grep -q "proj=longlat +R=6367470" $tempText ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl > $tempText -grep -q "proj=longlat" $tempText +grep -q "proj=longlat +R=6371229" $tempText ${tools_dir}/grib_set -s gridType=lambert_azimuthal_equal_area $grib2_sample $tempGrib From cbaf279dbbb96c9fe32996ea1eaae70def2944c7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 Mar 2023 14:49:29 +0000 Subject: [PATCH 181/212] ECC-1552: Revert for now (breaks Magics) --- src/grib_accessor_class_proj_string.cc | 12 +++++++----- tests/grib_proj_string.sh | 21 +++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/grib_accessor_class_proj_string.cc b/src/grib_accessor_class_proj_string.cc index 4e02e4cfd..92d99c2a1 100644 --- a/src/grib_accessor_class_proj_string.cc +++ b/src/grib_accessor_class_proj_string.cc @@ -294,7 +294,8 @@ static int proj_polar_stereographic(grib_handle* h, char* result) return err; } -// This is for regular_ll, regular_gg, reduced_ll, reduced_gg +#if 0 +// ECC-1552: This is for regular_ll, regular_gg, reduced_ll, reduced_gg static int proj_unprojected(grib_handle* h, char* result) { int err = 0; @@ -305,6 +306,7 @@ static int proj_unprojected(grib_handle* h, char* result) snprintf(result, 1024, "+proj=longlat %s", shape); return err; } +#endif static int proj_mercator(grib_handle* h, char* result) { @@ -323,10 +325,10 @@ static int proj_mercator(grib_handle* h, char* result) #define NUMBER(a) (sizeof(a) / sizeof(a[0])) static proj_mapping proj_mappings[] = { - { "regular_ll", &proj_unprojected }, - { "regular_gg", &proj_unprojected }, - { "reduced_ll", &proj_unprojected }, - { "reduced_gg", &proj_unprojected }, + // { "regular_ll", &proj_unprojected }, + // { "regular_gg", &proj_unprojected }, + // { "reduced_ll", &proj_unprojected }, + // { "reduced_gg", &proj_unprojected }, { "mercator", &proj_mercator }, { "lambert", &proj_lambert_conformal }, diff --git a/tests/grib_proj_string.sh b/tests/grib_proj_string.sh index 8400c3004..fe245782c 100755 --- a/tests/grib_proj_string.sh +++ b/tests/grib_proj_string.sh @@ -46,16 +46,17 @@ for f in `echo $files`; do done # Various grid types -${tools_dir}/grib_get -p projString $grib2_sample > $tempText -grep -q "proj=longlat +R=6367470" $tempText -${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_ll_pl_grib2.tmpl > $tempText -grep -q "proj=longlat +R=6371229" $tempText -${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_gg_ml_grib1.tmpl > $tempText -grep -q "proj=longlat +R=6367470" $tempText -${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl > $tempText -grep -q "proj=longlat +R=6367470" $tempText -${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl > $tempText -grep -q "proj=longlat +R=6371229" $tempText +# ECC-1552 +# ${tools_dir}/grib_get -p projString $grib2_sample > $tempText +# grep -q "proj=longlat +R=6367470" $tempText +# ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_ll_pl_grib2.tmpl > $tempText +# grep -q "proj=longlat +R=6371229" $tempText +# ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_gg_ml_grib1.tmpl > $tempText +# grep -q "proj=longlat +R=6367470" $tempText +# ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl > $tempText +# grep -q "proj=longlat +R=6367470" $tempText +# ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl > $tempText +# grep -q "proj=longlat +R=6371229" $tempText ${tools_dir}/grib_set -s gridType=lambert_azimuthal_equal_area $grib2_sample $tempGrib From f245ea37ddbd726f9a8f4d946d2a56c43762f9f7 Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Thu, 16 Mar 2023 08:27:33 +0000 Subject: [PATCH 182/212] grib_util_set_spec: gridType=lambert_azimuthal_equal_area keys (MIR-553, MIR-606) --- src/grib_util.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index 86f1c4db3..e5ff84cc6 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1159,16 +1159,16 @@ grib_handle* grib_util_set_spec2(grib_handle* h, COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees); COPY_SPEC_LONG(Ni); /* same as Nx */ COPY_SPEC_LONG(Nj); /* same as Ny */ - /* TODO: pass in extra keys e.g. Dx, Dy, standardParallel and centralLongitude */ + COPY_SPEC_LONG(iScansNegatively); + COPY_SPEC_LONG(jScansPositively); - /* - COPY_SPEC_LONG(DxInMetres); - COPY_SPEC_LONG(DyInMetres); - COPY_SPEC_LONG(xDirectionGridLengthInMillimetres); - COPY_SPEC_LONG(yDirectionGridLengthInMillimetres); - COPY_SPEC_LONG(standardParallelInMicrodegrees); - COPY_SPEC_LONG(centralLongitudeInMicrodegrees); - */ + // TODO: pass in extra keys e.g. Dx, Dy, standardParallel and centralLongitude + // COPY_SPEC_LONG(DxInMetres); + // COPY_SPEC_LONG(DyInMetres); + // COPY_SPEC_LONG(xDirectionGridLengthInMillimetres); + // COPY_SPEC_LONG(yDirectionGridLengthInMillimetres); + // COPY_SPEC_LONG(standardParallelInMicrodegrees); + // COPY_SPEC_LONG(centralLongitudeInMicrodegrees); break; case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: From 325efa1eef22587543708008547dafc4fbf85b9a Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Mon, 27 Feb 2023 13:02:41 +0100 Subject: [PATCH 183/212] Create reusable CI workflow --- .github/workflows/reusable-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/reusable-ci.yml diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml new file mode 100644 index 000000000..79f4cf53b --- /dev/null +++ b/.github/workflows/reusable-ci.yml @@ -0,0 +1,25 @@ +name: reusable-ci + +on: + workflow_call: + inputs: + eccodes: + required: false + type: string + +jobs: + ci: + name: eccodes-ci + uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v2 + with: + repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} + name_prefix: eccodes- + build_package_inputs: | + repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} + self_coverage: true + dependencies: | + ecmwf/ecbuild + MathisRosenhauer/libaec@master + dependency_branch: develop + parallelism_factor: 8 + secrets: inherit From 963b6b79670a5bfa25e936af51018c64b9022f2e Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Mon, 27 Feb 2023 13:06:06 +0100 Subject: [PATCH 184/212] Create HPC reusable CI workflow --- .github/workflows/reusable-ci-hpc.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/reusable-ci-hpc.yml diff --git a/.github/workflows/reusable-ci-hpc.yml b/.github/workflows/reusable-ci-hpc.yml new file mode 100644 index 000000000..3db33f2d2 --- /dev/null +++ b/.github/workflows/reusable-ci-hpc.yml @@ -0,0 +1,23 @@ +name: reusable-ci-hpc + +on: + workflow_call: + inputs: + eccodes: + required: false + type: string + +jobs: + ci-hpc: + name: ci-hpc + uses: ecmwf-actions/reusable-workflows/.github/workflows/ci-hpc.yml@v2 + with: + name-prefix: eccodes- + build-inputs: | + --package: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} + --modules: | + ecbuild + ninja + aec + --parallel: 64 + secrets: inherit From 6e24fac1032b53091390ad776b6b6f253c9f39a0 Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Mon, 27 Feb 2023 13:10:09 +0100 Subject: [PATCH 185/212] Trigger downstream CI --- .github/workflows/ci.yml | 76 +++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0017a99ee..5577e8d4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,33 +1,69 @@ name: ci -# Controls when the workflow will run on: - - # Trigger the workflow on all pushes, except on tag creation + # Trigger the workflow on push to master or develop, except tag creation push: branches: - - '**' + - 'master' + - 'develop' tags-ignore: - - '**' + - '**' - # Trigger the workflow on all pull requests - pull_request: ~ + # Trigger the workflow on pull request + pull_request_target: ~ - # Allow workflow to be dispatched on demand + # Trigger the workflow manually workflow_dispatch: ~ jobs: + # Run CI including downstream packages on self-hosted runners + downstream-ci: + name: downstream-ci + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main + with: + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} + secrets: inherit - # Calls a reusable CI workflow to build & test the current repository. - # It will pull in all needed dependencies and produce a code coverage report on success. - ci: - name: ci - uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v1 + # Run CI of private downstream packages on self-hosted runners + private-downstream-ci: + name: private-downstream-ci + needs: [downstream-ci] + if: success() || failure() + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Dispatch private downstream CI + uses: ecmwf-actions/dispatch-private-downstream-ci@v1 + with: + token: ${{ secrets.GH_REPO_READ_TOKEN }} + owner: ecmwf-actions + repository: private-downstream-ci + event_type: downstream-ci + payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' + + # Build downstream packages on HPC + downstream-ci-hpc: + name: downstream-ci-hpc + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main with: - codecov_upload: true - build_package_inputs: | - self_coverage: true - dependencies: | - ecmwf/ecbuild - MathisRosenhauer/libaec@master - dependency_branch: develop + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} + secrets: inherit + + # Run CI of private downstream packages on HPC + private-downstream-ci-hpc: + name: private-downstream-ci-hpc + needs: [downstream-ci-hpc] + if: success() || failure() + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Dispatch private downstream CI + uses: ecmwf-actions/dispatch-private-downstream-ci@v1 + with: + token: ${{ secrets.GH_REPO_READ_TOKEN }} + owner: ecmwf-actions + repository: private-downstream-ci + event_type: downstream-ci-hpc + payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' From 1dfa419c44c64ff382a136668156ae05658b32f6 Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Tue, 7 Mar 2023 11:21:01 +0100 Subject: [PATCH 186/212] Trigger CI when public PR is approved --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5577e8d4d..99f2ffff4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,15 +10,20 @@ on: - '**' # Trigger the workflow on pull request - pull_request_target: ~ + pull_request: ~ # Trigger the workflow manually workflow_dispatch: ~ + # Trigger after public PR approved for CI + pull_request_target: + types: [labeled] + jobs: # Run CI including downstream packages on self-hosted runners downstream-ci: name: downstream-ci + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main with: eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} @@ -28,7 +33,7 @@ jobs: private-downstream-ci: name: private-downstream-ci needs: [downstream-ci] - if: success() || failure() + if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} runs-on: ubuntu-latest permissions: pull-requests: write @@ -45,6 +50,7 @@ jobs: # Build downstream packages on HPC downstream-ci-hpc: name: downstream-ci-hpc + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main with: eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} @@ -54,7 +60,7 @@ jobs: private-downstream-ci-hpc: name: private-downstream-ci-hpc needs: [downstream-ci-hpc] - if: success() || failure() + if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} runs-on: ubuntu-latest permissions: pull-requests: write From 1658debfe88ca5e2b4b25bd74b10ed5bfedc8c15 Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Tue, 7 Mar 2023 11:21:25 +0100 Subject: [PATCH 187/212] Add workflow to manage public PR labels --- .github/workflows/label-public-pr.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/label-public-pr.yml diff --git a/.github/workflows/label-public-pr.yml b/.github/workflows/label-public-pr.yml new file mode 100644 index 000000000..59b2bfa2b --- /dev/null +++ b/.github/workflows/label-public-pr.yml @@ -0,0 +1,10 @@ +# Manage labels of pull requests that originate from forks +name: label-public-pr + +on: + pull_request_target: + types: [opened, synchronize] + +jobs: + label: + uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2 From 8ce6f20c14ea8adf195b1c1be277003ab4015517 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Mar 2023 15:52:13 +0000 Subject: [PATCH 188/212] Testing: Consistent naming of temporary files --- tests/grib_list.sh | 51 +++++++++++++----------- tests/grib_ls.sh | 81 +++++++++++++++++++-------------------- tests/grib_neg_fctime.sh | 10 ++--- tests/grib_proj_string.sh | 10 ++++- 4 files changed, 81 insertions(+), 71 deletions(-) diff --git a/tests/grib_list.sh b/tests/grib_list.sh index bf5d6d20b..c6cba10ad 100755 --- a/tests/grib_list.sh +++ b/tests/grib_list.sh @@ -10,34 +10,40 @@ . ./include.ctest.sh -cat > list.filter < $tempFilt <list.filter<$tempFilt<list.ref<$tempRef< /dev/null fi - echo "GRIB-387 printing key of type byte..." # ---------------------------------------------------------- ${tools_dir}/grib_ls -p uuidOfVGrid test_uuid.grib2 > /dev/null @@ -97,12 +100,11 @@ type=`${tools_dir}/grib_get -wcount=1 -p typeOfLevel test_uuid.grib2` echo "GRIB-213 nearest with land-sea mask..." # ---------------------------------------------------------- -temp_ls=temp.grib_ls.grib-213.txt -${tools_dir}/grib_ls -l 85,13,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls -grep -q 'Point chosen #3 index=21 .* distance=11\.' $temp_ls +${tools_dir}/grib_ls -l 85,13,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$tempText +grep -q 'Point chosen #3 index=21 .* distance=11\.' $tempText -${tools_dir}/grib_ls -l 53,2,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$temp_ls -grep -q 'Point chosen #2 index=749 .* distance=204\.' $temp_ls +${tools_dir}/grib_ls -l 53,2,1,reduced_gaussian_lsm.grib1 reduced_gaussian_surface.grib1 >$tempText +grep -q 'Point chosen #2 index=749 .* distance=204\.' $tempText echo "ECC-278: grib_ls -n namespace..." @@ -115,8 +117,6 @@ grib_check_key_equals $sample_g1 angleSubdivisions 1000 grib_check_key_equals $sample_g2 angleSubdivisions 1000000 # Print 'offset' key as string and integer -temp1=temp.grib_ls.1.txt -temp2=temp.grib_ls.2.txt ${tools_dir}/grib_ls -p offset:s tigge_cf_ecmwf.grib2 > $temp1 ${tools_dir}/grib_ls -p offset:i tigge_cf_ecmwf.grib2 > $temp2 diff $temp1 $temp2 @@ -128,59 +128,58 @@ grib_check_key_equals $sample_g2 'section0Pointer,section1Pointer,section3Pointe echo "Test constraints: -w option..." # ---------------------------------------------------------- file=tigge_pf_ecmwf.grib2 # Has 38 messages -${tools_dir}/grib_ls -w count!=1 $file > $temp_ls -grep -q "37 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w count!=1 $file > $tempText +grep -q "37 of 38 messages" $tempText -${tools_dir}/grib_ls -w count=1/2/38 $file > $temp_ls -grep -q "3 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w count=1/2/38 $file > $tempText +grep -q "3 of 38 messages" $tempText -${tools_dir}/grib_ls -w shortName=u $file > $temp_ls -grep -q "3 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w shortName=u $file > $tempText +grep -q "3 of 38 messages" $tempText -${tools_dir}/grib_ls -w shortName=u/v $file > $temp_ls -grep -q "5 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w shortName=u/v $file > $tempText +grep -q "5 of 38 messages" $tempText -${tools_dir}/grib_ls -w shortName!=u/v $file > $temp_ls -grep -q "33 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w shortName!=u/v $file > $tempText +grep -q "33 of 38 messages" $tempText -${tools_dir}/grib_ls -w shortName=u/v,level=925 $file > $temp_ls -grep -q "2 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w shortName=u/v,level=925 $file > $tempText +grep -q "2 of 38 messages" $tempText -${tools_dir}/grib_ls -w shortName=u/v/10u/10v,level=925/10 $file > $temp_ls -grep -q "4 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w shortName=u/v/10u/10v,level=925/10 $file > $tempText +grep -q "4 of 38 messages" $tempText -${tools_dir}/grib_ls -w packingType!=grid_simple $file > $temp_ls -grep -q "0 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w packingType!=grid_simple $file > $tempText +grep -q "0 of 38 messages" $tempText -${tools_dir}/grib_ls -w units!=K $file > $temp_ls -grep -q "30 of 38 messages" $temp_ls +${tools_dir}/grib_ls -w units!=K $file > $tempText +grep -q "30 of 38 messages" $tempText file=mixed.grib # Has 14 messages -${tools_dir}/grib_ls -w packingType=grid_simple,gridType=regular_ll/regular_gg $file > $temp_ls -grep -q "12 of 14 messages" $temp_ls +${tools_dir}/grib_ls -w packingType=grid_simple,gridType=regular_ll/regular_gg $file > $tempText +grep -q "12 of 14 messages" $tempText -${tools_dir}/grib_ls -w packingType=grid_simple/grid_simple_matrix,gridType=regular_ll/regular_gg $file > $temp_ls -grep -q "12 of 14 messages" $temp_ls +${tools_dir}/grib_ls -w packingType=grid_simple/grid_simple_matrix,gridType=regular_ll/regular_gg $file > $tempText +grep -q "12 of 14 messages" $tempText -${tools_dir}/grib_ls -w typeOfLevel=surface,centre=7 $file > $temp_ls -grep -q "3 of 14 messages" $temp_ls +${tools_dir}/grib_ls -w typeOfLevel=surface,centre=7 $file > $tempText +grep -q "3 of 14 messages" $tempText -${tools_dir}/grib_ls -w shortName=t/10u,gridType=regular_gg $file > $temp_ls -grep -q "5 of 14 messages" $temp_ls +${tools_dir}/grib_ls -w shortName=t/10u,gridType=regular_gg $file > $tempText +grep -q "5 of 14 messages" $tempText # ECC-1528: Try some invalid values for the count constraint for cval in -1 0 xx; do set +e - rm -f $temp_ls - ${tools_dir}/grib_ls -w count=$cval $file > $temp_ls 2>&1 + rm -f $tempText + ${tools_dir}/grib_ls -w count=$cval $file > $tempText 2>&1 status=$? set -e [ $status -ne 0 ] - grep -q "Invalid value for key 'count'" $temp_ls + grep -q "Invalid value for key 'count'" $tempText done # Clean up -rm -f $temp1 $temp2 -rm -f $temp_ls +rm -f $temp1 $temp2 $tempText $tempLog diff --git a/tests/grib_neg_fctime.sh b/tests/grib_neg_fctime.sh index 1905df9dd..3d0e5f88d 100755 --- a/tests/grib_neg_fctime.sh +++ b/tests/grib_neg_fctime.sh @@ -11,13 +11,12 @@ . ./include.ctest.sh REDIRECT=/dev/null - -temp=neg_fctime.temp.grib +label="grib_neg_fctime_test" +temp=temp.$label.grib input=${data_dir}/sample.grib2 - -############################ # Check various grib2 PDTs +# -------------------------- sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl PDTs="0 1 2 3 8 9 10 11 12 13 14 45 46 47 48 53" for p in $PDTs; do @@ -25,9 +24,8 @@ for p in $PDTs; do done -############################ - # check input time and date +# -------------------------- grib_check_key_equals $input 'dataDate,dataTime' '20080206 1200' # Negative step in same day diff --git a/tests/grib_proj_string.sh b/tests/grib_proj_string.sh index fe245782c..866cea794 100755 --- a/tests/grib_proj_string.sh +++ b/tests/grib_proj_string.sh @@ -46,7 +46,15 @@ for f in `echo $files`; do done # Various grid types -# ECC-1552 +# ECC-1552: To be done later. Current behaviour is to return KeyNotFound +set +e +${tools_dir}/grib_get -p projString $grib2_sample > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Key/value not found" $tempText +rm -f $tempText + # ${tools_dir}/grib_get -p projString $grib2_sample > $tempText # grep -q "proj=longlat +R=6367470" $tempText # ${tools_dir}/grib_get -p projString $ECCODES_SAMPLES_PATH/regular_ll_pl_grib2.tmpl > $tempText From 411b332592c55fbb225796be6cbd1b9b78f5d4b4 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Mar 2023 16:00:11 +0000 Subject: [PATCH 189/212] Testing: Consistent naming of temporary files --- tests/bufr_count.sh | 6 ++++-- tests/grib_iterator.sh | 6 +++--- tests/grib_local_NCEP.sh | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/bufr_count.sh b/tests/bufr_count.sh index a00c3fee9..14c1e4f0f 100755 --- a/tests/bufr_count.sh +++ b/tests/bufr_count.sh @@ -10,6 +10,9 @@ . ./include.ctest.sh +label="bufr_count_test" +temp=temp.$label.truncated.bufr + # Enter data dir cd ${data_dir}/bufr input=syno_multi.bufr @@ -23,7 +26,6 @@ count=`${tools_dir}/codes_count $input` # Files with invalid (unreadable) messages # ----------------------------------------- -temp=$input.truncated # BUFR file size = 660 bytes. Write out only the first 640 bytes # thereby creating an unreadable final message head -c 640 $input > $temp @@ -39,5 +41,5 @@ set -e vcount=`${tools_dir}/bufr_count -f $temp` [ "$vcount" = "2" ] - +# Clean up rm -f $temp diff --git a/tests/grib_iterator.sh b/tests/grib_iterator.sh index b6c3b3bc2..c8e0ffe78 100755 --- a/tests/grib_iterator.sh +++ b/tests/grib_iterator.sh @@ -9,8 +9,9 @@ # . ./include.ctest.sh -set -u -temp=temp.grib_iterator.grib + +label="grib_iterator_test" +temp=temp.$label.txt files="reduced_latlon_surface.grib1 \ reduced_gaussian_pressure_level.grib1 \ @@ -37,7 +38,6 @@ ${tools_dir}/grib_get_data -L%12.6f%11.5f ${data_dir}/regular_latlon_surface.gri ${tools_dir}/grib_get_data -p shortName,level ${data_dir}/regular_latlon_surface.grib2 > $temp grep -q "Latitude Longitude Value shortName level" $temp - # Run on a spectral field - should just print out its values ${tools_dir}/grib_get_data "$samp_dir/sh_ml_grib2.tmpl" diff --git a/tests/grib_local_NCEP.sh b/tests/grib_local_NCEP.sh index 478b57a4b..1cb734fc8 100755 --- a/tests/grib_local_NCEP.sh +++ b/tests/grib_local_NCEP.sh @@ -10,7 +10,8 @@ . ./include.ctest.sh -temp=output.grib_local_NCEP.grib +label="grib_local_NCEP_test" +temp=temp.$label.grib sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl ${tools_dir}/grib_set -s centre=kwbc,discipline=3,parameterCategory=192,parameterNumber=35 $sample $temp From 8fb3040f0beb553ab28daad8f80ecdbf70fc8d93 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Mar 2023 17:03:12 +0000 Subject: [PATCH 190/212] Improved debug messages --- src/grib_accessor.cc | 8 +++---- ...cessor_class_data_apply_boustrophedonic.cc | 2 +- src/grib_accessor_class_data_ccsds_packing.cc | 2 +- src/grib_accessor_class_g1step_range.cc | 21 ++++++++++++++----- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/grib_accessor.cc b/src/grib_accessor.cc index e1e8c6dcc..44e5fe0ea 100644 --- a/src/grib_accessor.cc +++ b/src/grib_accessor.cc @@ -236,14 +236,14 @@ int grib_unpack_float(grib_accessor* a, float* v, size_t* len) return 0; } -template <> -int grib_unpack(grib_accessor* a, double* v, size_t* len) +template <> +int grib_unpack(grib_accessor* a, double* v, size_t* len) { return grib_unpack_double(a, v, len); } -template <> -int grib_unpack(grib_accessor* a, float* v, size_t* len) +template <> +int grib_unpack(grib_accessor* a, float* v, size_t* len) { return grib_unpack_float(a, v, len); } diff --git a/src/grib_accessor_class_data_apply_boustrophedonic.cc b/src/grib_accessor_class_data_apply_boustrophedonic.cc index 1f642c8d0..c512cc4a3 100644 --- a/src/grib_accessor_class_data_apply_boustrophedonic.cc +++ b/src/grib_accessor_class_data_apply_boustrophedonic.cc @@ -181,7 +181,7 @@ static int value_count(grib_accessor* a, long* numberOfPoints) return ret; } -template +template static int unpack(grib_accessor* a, T* val, size_t* len) { grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a; diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index a28afa6cc..0a7c944b3 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -232,7 +232,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) grib_handle* hand = grib_handle_of_accessor(a); int err = GRIB_SUCCESS; size_t buflen = 0, i = 0; - bool is_constant_field = false; + bool is_constant_field = false; unsigned char* buf = NULL; unsigned char* encoded = NULL; diff --git a/src/grib_accessor_class_g1step_range.cc b/src/grib_accessor_class_g1step_range.cc index acf30c9f2..067bfff5f 100644 --- a/src/grib_accessor_class_g1step_range.cc +++ b/src/grib_accessor_class_g1step_range.cc @@ -499,7 +499,7 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) size_t stepTypeLen = 20; if (self->stepType) { - ret = grib_get_string_internal(grib_handle_of_accessor(a), self->stepType, stepType, &stepTypeLen); + ret = grib_get_string_internal(h, self->stepType, stepType, &stepTypeLen); if (ret) return ret; } @@ -578,12 +578,18 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) } off = p1_accessor->offset * 8; /* Note: here we assume the key P2 is one octet and immediately follows P1. Hence 16 bits */ - if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (as two octets)\n", p1_accessor->name, P1); + ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1, &off, 16); if (ret != 0) return ret; + if (h->context->debug) { + long dp1,dp2; + grib_get_long(h, self->p1, &dp1); + grib_get_long(h, self->p2, &dp2); + fprintf(stderr, "ECCODES DEBUG pack_string: P1=%ld P2=%ld (as two octets => %ld)\n", dp1, dp2, P1); + } + if (ounit != unit) ret = grib_set_long_internal(h, self->unit, unit); @@ -622,12 +628,17 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) /* Note: case for timeRangeIndicator of 10 * We assume the key P2 is one octet and immediately follows P1. Hence 16 bits */ - if (h->context->debug) - fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (as two octets)\n", p1_accessor->name, P1); ret = grib_encode_unsigned_long(grib_handle_of_accessor(a)->buffer->data, P1, &off, 16); if (ret != 0) return ret; + if (h->context->debug) { + long dp1,dp2; + grib_get_long(h, self->p1, &dp1); + grib_get_long(h, self->p2, &dp2); + fprintf(stderr, "ECCODES DEBUG pack_string: P1=%ld P2=%ld (as two octets => %ld)\n", dp1, dp2, P1); + } + if (ounit != unit) ret = grib_set_long_internal(h, self->unit, unit); } From 69f46619a1e7fff087c303f24f9f9f65d3ae3528 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Mar 2023 18:50:40 +0000 Subject: [PATCH 191/212] cpplint warnings --- src/grib_accessor_class_data_ccsds_packing.cc | 2 +- src/grib_util.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index 0a7c944b3..bbf75696b 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -529,7 +529,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) if ((err = grib_get_long_internal(hand, self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) return err; - // TODO: This should be called upstream + // TODO(masn): This should be called upstream if (*len < n_vals) return GRIB_ARRAY_TOO_SMALL; diff --git a/src/grib_util.cc b/src/grib_util.cc index e5ff84cc6..2b8735650 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1162,7 +1162,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, COPY_SPEC_LONG(iScansNegatively); COPY_SPEC_LONG(jScansPositively); - // TODO: pass in extra keys e.g. Dx, Dy, standardParallel and centralLongitude + // TODO(masn): pass in extra keys e.g. Dx, Dy, standardParallel and centralLongitude // COPY_SPEC_LONG(DxInMetres); // COPY_SPEC_LONG(DyInMetres); // COPY_SPEC_LONG(xDirectionGridLengthInMillimetres); @@ -1174,7 +1174,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: COPY_SPEC_LONG(bitmapPresent); if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); - /* TODO: Other keys */ + /* TODO(masn): Other keys */ break; case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL: COPY_SPEC_LONG(bitmapPresent); @@ -1192,7 +1192,7 @@ grib_handle* grib_util_set_spec2(grib_handle* h, // Note: DxInMetres and DyInMetres // should be 'double' and not integer. WMO GRIB2 uses millimetres! - // TODO: Add other keys like Latin1, LoV etc + // TODO(masn): Add other keys like Latin1, LoV etc break; From 28f3e6945f62d4a6527648bfb11f6460766a5d01 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 18 Mar 2023 18:51:20 +0000 Subject: [PATCH 192/212] Improved error messages re keys P1, P2 --- src/grib_accessor_class_g1step_range.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/grib_accessor_class_g1step_range.cc b/src/grib_accessor_class_g1step_range.cc index 067bfff5f..308929d46 100644 --- a/src/grib_accessor_class_g1step_range.cc +++ b/src/grib_accessor_class_g1step_range.cc @@ -643,6 +643,10 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) ret = grib_set_long_internal(h, self->unit, unit); } + if (ret == GRIB_WRONG_STEP) { + grib_context_log(h->context, GRIB_LOG_ERROR, + "Failed to set %s=%s: Keys P1 and P2 are one octet each (Range 0 to 255)", a->name, val); + } return ret; } From 3c209f77923f0ecc46cf934612d72cf7106380ed Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Mar 2023 14:43:36 +0000 Subject: [PATCH 193/212] Testing: Padded count in filter --- tests/grib_filter.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index 39636c60c..c6c0a48f7 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -280,6 +280,26 @@ set -e grep -q "ECCODES ERROR.*Number is too large" $tempOut +echo "Padded count for filenames" +# ----------------------------------------- +input=${data_dir}/tigge_af_ecmwf.grib2 +tempDir=temp.${label}.dir +rm -fr $tempDir +mkdir -p $tempDir +cd $tempDir +cat >$tempFilt < Date: Thu, 23 Mar 2023 15:08:33 +0000 Subject: [PATCH 194/212] Testing: Consistent naming of temporary files --- tests/grib_octahedral.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/grib_octahedral.sh b/tests/grib_octahedral.sh index 3207bcaa1..b4f3ebf07 100755 --- a/tests/grib_octahedral.sh +++ b/tests/grib_octahedral.sh @@ -12,8 +12,8 @@ REDIRECT=/dev/null -this_test="octa_grid.test" -temp=temp.$this_test +label="grib_octahedral_test" +temp=temp.$label.txt # All our current GRIB samples (with reduced gaussian grids) are NON-Octahedral for s in $ECCODES_SAMPLES_PATH/reduced_gg_pl*.tmpl; do From 7d803c684de44407eb1ac529f1ed6c1b5096e27a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Mar 2023 15:17:18 +0000 Subject: [PATCH 195/212] Testing: Deprecated tests --- CMakeLists.txt | 2 +- tests/{tests.ecmwf => deprecated}/chemical.c | 0 tests/{tests.ecmwf => deprecated}/compare.c | 0 tests/{tests.ecmwf => deprecated}/compatibility.c | 0 tests/{tests.ecmwf => deprecated}/compatibility.test | 0 tests/{tests.ecmwf => deprecated}/compatibility_ex.c | 0 tests/{tests.ecmwf => deprecated}/concept | 0 tests/{tests.ecmwf => deprecated}/concept.test | 0 tests/{tests.ecmwf => deprecated}/deserialize.c | 0 tests/{tests.ecmwf => deprecated}/dump.test | 0 tests/{tests.ecmwf => deprecated}/filter | 0 tests/{tests.ecmwf => deprecated}/filter.test | 0 tests/{tests.ecmwf => deprecated}/grib1to2.c | 0 tests/{tests.ecmwf => deprecated}/grib1to2.test | 0 tests/{tests.ecmwf => deprecated}/grib_ls | 0 tests/{tests.ecmwf => deprecated}/grib_ls.test | 0 tests/{tests.ecmwf => deprecated}/gribex | 0 tests/{tests.ecmwf => deprecated}/gribex.test | 0 tests/{tests.ecmwf => deprecated}/memory.c | 0 tests/{tests.ecmwf => deprecated}/memory.test | 0 tests/{tests.ecmwf => deprecated}/packing.c | 0 tests/{tests.ecmwf => deprecated}/packing.test | 0 tests/{tests.ecmwf => deprecated}/request.c | 0 tests/{tests.ecmwf => deprecated}/sample.c | 0 tests/{tests.ecmwf => deprecated}/sample1.c | 0 tests/{tests.ecmwf => deprecated}/serialize.c | 0 tests/{tests.ecmwf => deprecated}/set | 0 tests/{tests.ecmwf => deprecated}/set.test | 0 tests/{tests.ecmwf => deprecated}/set1to2 | 0 tests/{tests.ecmwf => deprecated}/set1to2.test | 0 tests/{tests.ecmwf => deprecated}/skip.t | 0 tests/{tests.ecmwf => deprecated}/test.h | 0 tests/{tests.ecmwf => deprecated}/test.ksh | 0 tests/{tests.ecmwf => deprecated}/tests | 0 tests/{tests.ecmwf => deprecated}/values.c | 0 tests/{tests.ecmwf => deprecated}/values.test | 0 36 files changed, 1 insertion(+), 1 deletion(-) rename tests/{tests.ecmwf => deprecated}/chemical.c (100%) rename tests/{tests.ecmwf => deprecated}/compare.c (100%) rename tests/{tests.ecmwf => deprecated}/compatibility.c (100%) rename tests/{tests.ecmwf => deprecated}/compatibility.test (100%) rename tests/{tests.ecmwf => deprecated}/compatibility_ex.c (100%) rename tests/{tests.ecmwf => deprecated}/concept (100%) rename tests/{tests.ecmwf => deprecated}/concept.test (100%) rename tests/{tests.ecmwf => deprecated}/deserialize.c (100%) rename tests/{tests.ecmwf => deprecated}/dump.test (100%) rename tests/{tests.ecmwf => deprecated}/filter (100%) rename tests/{tests.ecmwf => deprecated}/filter.test (100%) rename tests/{tests.ecmwf => deprecated}/grib1to2.c (100%) rename tests/{tests.ecmwf => deprecated}/grib1to2.test (100%) rename tests/{tests.ecmwf => deprecated}/grib_ls (100%) rename tests/{tests.ecmwf => deprecated}/grib_ls.test (100%) rename tests/{tests.ecmwf => deprecated}/gribex (100%) rename tests/{tests.ecmwf => deprecated}/gribex.test (100%) rename tests/{tests.ecmwf => deprecated}/memory.c (100%) rename tests/{tests.ecmwf => deprecated}/memory.test (100%) rename tests/{tests.ecmwf => deprecated}/packing.c (100%) rename tests/{tests.ecmwf => deprecated}/packing.test (100%) rename tests/{tests.ecmwf => deprecated}/request.c (100%) rename tests/{tests.ecmwf => deprecated}/sample.c (100%) rename tests/{tests.ecmwf => deprecated}/sample1.c (100%) rename tests/{tests.ecmwf => deprecated}/serialize.c (100%) rename tests/{tests.ecmwf => deprecated}/set (100%) rename tests/{tests.ecmwf => deprecated}/set.test (100%) rename tests/{tests.ecmwf => deprecated}/set1to2 (100%) rename tests/{tests.ecmwf => deprecated}/set1to2.test (100%) rename tests/{tests.ecmwf => deprecated}/skip.t (100%) rename tests/{tests.ecmwf => deprecated}/test.h (100%) rename tests/{tests.ecmwf => deprecated}/test.ksh (100%) rename tests/{tests.ecmwf => deprecated}/tests (100%) rename tests/{tests.ecmwf => deprecated}/values.c (100%) rename tests/{tests.ecmwf => deprecated}/values.test (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a01e72413..53fde23d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,7 +431,7 @@ add_subdirectory( ifs_samples ) # must come after samples # ecbuild_dont_pack( DIRS samples DONT_PACK_REGEX "*.grib" ) ecbuild_dont_pack( DIRS - experimental deprecated doxygen confluence tests/tests.ecmwf + experimental deprecated doxygen confluence tests/deprecated tests/tests.ecmwf config m4 examples/F77 src/deprecated tools/deprecated ifs_samples/grib1_mlgrib2_ieee32 examples/examples.dev examples/extra examples/deprecated bamboo fortran/fortranCtypes tigge/tools share/eccodes .settings ) diff --git a/tests/tests.ecmwf/chemical.c b/tests/deprecated/chemical.c similarity index 100% rename from tests/tests.ecmwf/chemical.c rename to tests/deprecated/chemical.c diff --git a/tests/tests.ecmwf/compare.c b/tests/deprecated/compare.c similarity index 100% rename from tests/tests.ecmwf/compare.c rename to tests/deprecated/compare.c diff --git a/tests/tests.ecmwf/compatibility.c b/tests/deprecated/compatibility.c similarity index 100% rename from tests/tests.ecmwf/compatibility.c rename to tests/deprecated/compatibility.c diff --git a/tests/tests.ecmwf/compatibility.test b/tests/deprecated/compatibility.test similarity index 100% rename from tests/tests.ecmwf/compatibility.test rename to tests/deprecated/compatibility.test diff --git a/tests/tests.ecmwf/compatibility_ex.c b/tests/deprecated/compatibility_ex.c similarity index 100% rename from tests/tests.ecmwf/compatibility_ex.c rename to tests/deprecated/compatibility_ex.c diff --git a/tests/tests.ecmwf/concept b/tests/deprecated/concept similarity index 100% rename from tests/tests.ecmwf/concept rename to tests/deprecated/concept diff --git a/tests/tests.ecmwf/concept.test b/tests/deprecated/concept.test similarity index 100% rename from tests/tests.ecmwf/concept.test rename to tests/deprecated/concept.test diff --git a/tests/tests.ecmwf/deserialize.c b/tests/deprecated/deserialize.c similarity index 100% rename from tests/tests.ecmwf/deserialize.c rename to tests/deprecated/deserialize.c diff --git a/tests/tests.ecmwf/dump.test b/tests/deprecated/dump.test similarity index 100% rename from tests/tests.ecmwf/dump.test rename to tests/deprecated/dump.test diff --git a/tests/tests.ecmwf/filter b/tests/deprecated/filter similarity index 100% rename from tests/tests.ecmwf/filter rename to tests/deprecated/filter diff --git a/tests/tests.ecmwf/filter.test b/tests/deprecated/filter.test similarity index 100% rename from tests/tests.ecmwf/filter.test rename to tests/deprecated/filter.test diff --git a/tests/tests.ecmwf/grib1to2.c b/tests/deprecated/grib1to2.c similarity index 100% rename from tests/tests.ecmwf/grib1to2.c rename to tests/deprecated/grib1to2.c diff --git a/tests/tests.ecmwf/grib1to2.test b/tests/deprecated/grib1to2.test similarity index 100% rename from tests/tests.ecmwf/grib1to2.test rename to tests/deprecated/grib1to2.test diff --git a/tests/tests.ecmwf/grib_ls b/tests/deprecated/grib_ls similarity index 100% rename from tests/tests.ecmwf/grib_ls rename to tests/deprecated/grib_ls diff --git a/tests/tests.ecmwf/grib_ls.test b/tests/deprecated/grib_ls.test similarity index 100% rename from tests/tests.ecmwf/grib_ls.test rename to tests/deprecated/grib_ls.test diff --git a/tests/tests.ecmwf/gribex b/tests/deprecated/gribex similarity index 100% rename from tests/tests.ecmwf/gribex rename to tests/deprecated/gribex diff --git a/tests/tests.ecmwf/gribex.test b/tests/deprecated/gribex.test similarity index 100% rename from tests/tests.ecmwf/gribex.test rename to tests/deprecated/gribex.test diff --git a/tests/tests.ecmwf/memory.c b/tests/deprecated/memory.c similarity index 100% rename from tests/tests.ecmwf/memory.c rename to tests/deprecated/memory.c diff --git a/tests/tests.ecmwf/memory.test b/tests/deprecated/memory.test similarity index 100% rename from tests/tests.ecmwf/memory.test rename to tests/deprecated/memory.test diff --git a/tests/tests.ecmwf/packing.c b/tests/deprecated/packing.c similarity index 100% rename from tests/tests.ecmwf/packing.c rename to tests/deprecated/packing.c diff --git a/tests/tests.ecmwf/packing.test b/tests/deprecated/packing.test similarity index 100% rename from tests/tests.ecmwf/packing.test rename to tests/deprecated/packing.test diff --git a/tests/tests.ecmwf/request.c b/tests/deprecated/request.c similarity index 100% rename from tests/tests.ecmwf/request.c rename to tests/deprecated/request.c diff --git a/tests/tests.ecmwf/sample.c b/tests/deprecated/sample.c similarity index 100% rename from tests/tests.ecmwf/sample.c rename to tests/deprecated/sample.c diff --git a/tests/tests.ecmwf/sample1.c b/tests/deprecated/sample1.c similarity index 100% rename from tests/tests.ecmwf/sample1.c rename to tests/deprecated/sample1.c diff --git a/tests/tests.ecmwf/serialize.c b/tests/deprecated/serialize.c similarity index 100% rename from tests/tests.ecmwf/serialize.c rename to tests/deprecated/serialize.c diff --git a/tests/tests.ecmwf/set b/tests/deprecated/set similarity index 100% rename from tests/tests.ecmwf/set rename to tests/deprecated/set diff --git a/tests/tests.ecmwf/set.test b/tests/deprecated/set.test similarity index 100% rename from tests/tests.ecmwf/set.test rename to tests/deprecated/set.test diff --git a/tests/tests.ecmwf/set1to2 b/tests/deprecated/set1to2 similarity index 100% rename from tests/tests.ecmwf/set1to2 rename to tests/deprecated/set1to2 diff --git a/tests/tests.ecmwf/set1to2.test b/tests/deprecated/set1to2.test similarity index 100% rename from tests/tests.ecmwf/set1to2.test rename to tests/deprecated/set1to2.test diff --git a/tests/tests.ecmwf/skip.t b/tests/deprecated/skip.t similarity index 100% rename from tests/tests.ecmwf/skip.t rename to tests/deprecated/skip.t diff --git a/tests/tests.ecmwf/test.h b/tests/deprecated/test.h similarity index 100% rename from tests/tests.ecmwf/test.h rename to tests/deprecated/test.h diff --git a/tests/tests.ecmwf/test.ksh b/tests/deprecated/test.ksh similarity index 100% rename from tests/tests.ecmwf/test.ksh rename to tests/deprecated/test.ksh diff --git a/tests/tests.ecmwf/tests b/tests/deprecated/tests similarity index 100% rename from tests/tests.ecmwf/tests rename to tests/deprecated/tests diff --git a/tests/tests.ecmwf/values.c b/tests/deprecated/values.c similarity index 100% rename from tests/tests.ecmwf/values.c rename to tests/deprecated/values.c diff --git a/tests/tests.ecmwf/values.test b/tests/deprecated/values.test similarity index 100% rename from tests/tests.ecmwf/values.test rename to tests/deprecated/values.test From f92e63ac0a4b5b7d9de703b8b85837be25c84270 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Mar 2023 15:23:04 +0000 Subject: [PATCH 196/212] Remove deprecated file --- examples/C/ecmwf_link.sh | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100755 examples/C/ecmwf_link.sh diff --git a/examples/C/ecmwf_link.sh b/examples/C/ecmwf_link.sh deleted file mode 100755 index f8180b1e4..000000000 --- a/examples/C/ecmwf_link.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# (C) Copyright 2005- ECMWF. -# -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. -# -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. - -set -ex - -CC=xlc -FC=xlf - -jasper_lib="-I/usr/local/lib/metaps/lib/grib_api/jasper/include -L/usr/local/lib/metaps/lib/grib_api/jasper/lib -ljasper" -grib_api_lib="-I/usr/local/lib/metaps/lib/grib_api/new/include -L/usr/local/lib/metaps/lib/grib_api/new/lib -lgrib_api" - -$CC -o multi multi.c $jasper_lib $grib_api_lib -lm - -./multi > /dev/null - -$FC -o multi_fortran multi_fortran.F $jasper_lib $grib_api_lib - -./multi_fortran > /dev/null - - From 1002b600228dc9e608a8a87b4b8be675ca446c88 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 24 Mar 2023 10:14:19 +0000 Subject: [PATCH 197/212] CMake: exclude deprecated files/dirs from CPack --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53fde23d5..f7085bcae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,11 +430,12 @@ add_subdirectory( samples ) add_subdirectory( ifs_samples ) # must come after samples # ecbuild_dont_pack( DIRS samples DONT_PACK_REGEX "*.grib" ) +ecbuild_dont_pack( FILES .cproject .project ) ecbuild_dont_pack( DIRS - experimental deprecated doxygen confluence tests/deprecated tests/tests.ecmwf - config m4 examples/F77 src/deprecated tools/deprecated ifs_samples/grib1_mlgrib2_ieee32 - examples/examples.dev examples/extra examples/deprecated bamboo - fortran/fortranCtypes tigge/tools share/eccodes .settings ) + experimental deprecated doxygen confluence tests/deprecated tests/tests.ecmwf + src/deprecated tools/deprecated ifs_samples/grib1_mlgrib2_ieee32 + examples/examples.dev examples/extra examples/deprecated bamboo + fortran/fortranCtypes tigge/tools share/eccodes .settings ) #ecbuild_dont_pack( DIRS data/bufr DONT_PACK_REGEX "*.bufr" ) #ecbuild_dont_pack( DIRS data/tigge DONT_PACK_REGEX "*.grib" ) From 25d8879954144119a64a5715edd8400860c6a7df Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 24 Mar 2023 17:03:42 +0000 Subject: [PATCH 198/212] Definitions: Cleanup --- definitions/grib2/template.5.53.def | 2 +- definitions/grib2/template.7.53.def | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/definitions/grib2/template.5.53.def b/definitions/grib2/template.5.53.def index 9c52a8513..2ca21b70f 100644 --- a/definitions/grib2/template.5.53.def +++ b/definitions/grib2/template.5.53.def @@ -1,7 +1,7 @@ # (C) Copyright 2005- ECMWF. # TEMPLATE 5.53, BiFourier coefficients data - complex packing -# Spectral data for limited area models \u2013 complex packing +# Spectral data for limited area models - complex packing include "grib2/template.5.packing.def"; diff --git a/definitions/grib2/template.7.53.def b/definitions/grib2/template.7.53.def index ad4642bbf..e12e83b19 100644 --- a/definitions/grib2/template.7.53.def +++ b/definitions/grib2/template.7.53.def @@ -1,7 +1,6 @@ # (C) Copyright 2005- ECMWF. -# TEMPLATE 7.53, BiFourier coefficients - complex packing -# Spectral data for limited area models \u2013 complex packing +# TEMPLATE 7.53, Bi-Fourier: Spectral data for limited area models - complex packing constant biFourierCoefficients = 1; constant complexPacking = 1; @@ -39,9 +38,10 @@ meta codedValues data_g2bifourier_packing( numberOfValues ): read_only; -meta values data_apply_bitmap(codedValues, - bitmap, - missingValue, - binaryScaleFactor, - numberOfDataPoints, - numberOfValues) : dump; +meta values data_apply_bitmap( + codedValues, + bitmap, + missingValue, + binaryScaleFactor, + numberOfDataPoints, + numberOfValues) : dump; From 07e8affd43747ee576a5eaf96d4ed7e26e90d953 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 25 Mar 2023 14:25:01 +0000 Subject: [PATCH 199/212] Testing: Checking Gaussian grids --- tests/grib_check_gaussian_grids.sh | 39 +++++++++++++++++++++++++++--- tools/grib_check_gaussian_grid.cc | 9 +++++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/tests/grib_check_gaussian_grids.sh b/tests/grib_check_gaussian_grids.sh index ec6adb8b7..3d5dc7169 100755 --- a/tests/grib_check_gaussian_grids.sh +++ b/tests/grib_check_gaussian_grids.sh @@ -10,7 +10,8 @@ . ./include.ctest.sh label="grib_check_gaussian_grids_test" -temp=temp.$label.grib +tempGrib=temp.$label.grib +tempText=temp.$label.txt # Check all sample GRIBs with a Gaussian grid @@ -20,14 +21,44 @@ for gg in ${samples_dir}/reduced_gg_* ${samples_dir}/regular_gg_*; do grib_check_key_equals $gg "global" 1 done +for gg in ${samples_dir}/reduced_gg_*tmpl; do + ${tools_dir}/grib_set -s global=1 $gg $tempGrib + ${tools_dir}/grib_check_gaussian_grid $tempGrib +done + + # Set wrong angle and re-test. Should fail input=$samples_dir/reduced_gg_pl_1280_grib2.tmpl -${tools_dir}/grib_set -s longitudeOfLastGridPoint=359929680 $input $temp +${tools_dir}/grib_set -s longitudeOfLastGridPoint=359929680 $input $tempGrib +set +e +${tools_dir}/grib_check_gaussian_grid -v $tempGrib 2> $tempText +status=$? +set -e +[ $status -eq 1 ] +grep -q "Error: longitudeOfLastGridPointInDegrees.*but should be" $tempText + + +# Set wrong numberOfDataPoints and re-test. Should fail +input=$samples_dir/reduced_gg_pl_96_grib2.tmpl +${tools_dir}/grib_set -s numberOfDataPoints=44 $input $tempGrib +set +e +${tools_dir}/grib_check_gaussian_grid -v $tempGrib 2> $tempText +status=$? +set -e +[ $status -eq 1 ] +grep -q "Error: Sum of pl array 50662 does not match numberOfDataPoints 44" $tempText + + +# Set wrong numberOfValues and re-test. Should fail +input=$samples_dir/reduced_gg_pl_96_grib2.tmpl +${tools_dir}/grib_set -s numberOfValues=44 $input $tempGrib set +e -${tools_dir}/grib_check_gaussian_grid -v $temp +${tools_dir}/grib_check_gaussian_grid -v $tempGrib 2> $tempText status=$? set -e [ $status -eq 1 ] +cat $tempText +grep -q "Error: Sum of pl array 50662 does not match numberOfValues 44" $tempText -rm -f $temp +rm -f $tempGrib $tempText diff --git a/tools/grib_check_gaussian_grid.cc b/tools/grib_check_gaussian_grid.cc index c3180903d..aea038b3b 100644 --- a/tools/grib_check_gaussian_grid.cc +++ b/tools/grib_check_gaussian_grid.cc @@ -97,7 +97,7 @@ static int process_file(const char* filename) while ((h = grib_handle_new_from_file(0, in, &err)) != NULL) { int is_reduced_gaussian = 0, is_regular_gaussian = 0, grid_ok = 0; - long edition = 0, N = 0, Nj = 0, numberOfDataPoints; + long edition = 0, N = 0, Nj = 0, numberOfDataPoints, numberOfValues; size_t len = 0, sizeOfValuesArray = 0; double* lats = NULL; long* pl = NULL; @@ -128,6 +128,7 @@ static int process_file(const char* filename) GRIB_CHECK(grib_get_long(h, "N", &N), 0); GRIB_CHECK(grib_get_long(h, "Nj", &Nj), 0); GRIB_CHECK(grib_get_long(h, "numberOfDataPoints", &numberOfDataPoints), 0); + GRIB_CHECK(grib_get_long(h, "numberOfValues", &numberOfValues), 0); GRIB_CHECK(grib_get_double(h, "latitudeOfFirstGridPointInDegrees", &lat1), 0); GRIB_CHECK(grib_get_double(h, "longitudeOfFirstGridPointInDegrees", &lon1), 0); GRIB_CHECK(grib_get_double(h, "latitudeOfLastGridPointInDegrees", &lat2), 0); @@ -165,7 +166,8 @@ static int process_file(const char* filename) } if (is_reduced_gaussian) { - int pl_sum = 0, max_pl = 0, is_missing_Ni = 0, is_missing_Di = 0; + int is_missing_Ni = 0, is_missing_Di = 0; + long pl_sum = 0, max_pl = 0; size_t i = 0, pl_len = 0; long is_octahedral = 0; long interpretationOfNumberOfPoints = 0; @@ -215,6 +217,9 @@ static int process_file(const char* filename) if (pl_sum != numberOfDataPoints) { error(filename, msg_num, "Sum of pl array %ld does not match numberOfDataPoints %ld\n", pl_sum, numberOfDataPoints); } + if (pl_sum != numberOfValues) { + error(filename, msg_num, "Sum of pl array %ld does not match numberOfValues %ld\n", pl_sum, numberOfValues); + } GRIB_CHECK(grib_get_long(h, "isOctahedral", &is_octahedral), 0); if (is_octahedral) { if (verbose) From 1a8ddb5a229fddc69213f002e23ed63817cf1628 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 27 Mar 2023 11:12:35 +0100 Subject: [PATCH 200/212] ECC-1557 and ECC-1556: New MARS classes D1 and ML --- definitions/mars/class.table | 2 ++ 1 file changed, 2 insertions(+) diff --git a/definitions/mars/class.table b/definitions/mars/class.table index 516e43217..6e8a0aa27 100644 --- a/definitions/mars/class.table +++ b/definitions/mars/class.table @@ -43,6 +43,8 @@ 42 ef EFAS (European flood awareness system) 43 gf GLOFAS (Global flood awareness system) 44 gg Greenhouse Gases +45 ml Machine learning +46 d1 Destination Earth 99 te Test 100 at Austria 101 be Belgium From a9fae8c2b56314466a4ff53ee72cfbf15dfadb43 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 27 Mar 2023 19:38:45 +0000 Subject: [PATCH 201/212] Scripts: Improve sanity checking --- definitions/add_params_from_tsv.pl | 47 ++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/definitions/add_params_from_tsv.pl b/definitions/add_params_from_tsv.pl index e13b7b86e..6be601f53 100755 --- a/definitions/add_params_from_tsv.pl +++ b/definitions/add_params_from_tsv.pl @@ -105,6 +105,7 @@ if ($SANITY_CHECK) { my %map_sn = (); # map of shortNames my %map_pid = (); # map of paramIds + my $sanity_error_count = 0; print "Checking sanity: uniqueness of paramId and shortName keys ...\n"; while (<>) { chomp; @@ -122,21 +123,42 @@ die "Error: paramId=$paramId is duplicated (line ", $lcount+1, ")\n" if (exists $map_pid{$paramId}); $map_pid{$paramId}++; # increment count in paramId map - die "Error: paramId=$paramId is not an integer (line ", $lcount+1, ")\n" if (!is_integer($paramId)); + if (!is_integer($paramId)) { + warn "Error: paramId=$paramId is not an integer (line ", $lcount+1, ")\n" ; + $sanity_error_count++; + } my $x = $dbh->selectrow_array("select * from param.param where id = ?",undef,$paramId); - die "Error: paramId=$x exists in the database (line ", $lcount+1, ")\n" if (defined $x); - - die "Error: Name '$name': ends in space" if ($name =~ / $/); - die "Error: Name '$name': starts with space" if ($name =~ /^ /); + if (defined $x) { + warn "Error: paramId=$x exists in the database (line ", $lcount+1, ")\n"; + $sanity_error_count++; + } - # Will die if it fails - get_db_units_code($units); + if ($name =~ / $/) { + die "Error: Name '$name': ends in space" ; + $sanity_error_count++; + } + if ($name =~ /^ /) { + die "Error: Name '$name': starts with space" ; + $sanity_error_count++; + } $x = $dbh->selectrow_array("select shortName from param.param where shortName = ?",undef,$shortName); - die "Error: shortName=$x exists in the database (line ", $lcount+1, ")\n" if (defined $x); + if (defined $x) { + warn "Error: shortName=$x exists in the database (line ", $lcount+1, ")\n"; + $sanity_error_count++; + } + + if (!check_units($units)) { + warn "Error: Database does not contain units=$units (line ", $lcount+1, ")\n"; + $sanity_error_count++; + } + } + if ($sanity_error_count == 0) { + print "\nSanity checking completed. $lcount rows checked. No errors.\n"; + } else { + die "\nSanity checking FAILED. $lcount rows checked. $sanity_error_count error(s).\n"; } - print "\nSanity checking completed. $lcount rows checked. No errors.\nExiting.\n"; exit 0; } @@ -298,6 +320,13 @@ sub centre_as_str { return "ECMWF" if ($cc eq $centre_ecmwf); return "Unknown"; } +sub check_units { + my $u = shift; + my $unit_id = $dbh->selectrow_array("select id from units where name = ?",undef,$u); + return 0 if (!$unit_id); + return 1; +} + sub get_db_units_code { my $u = shift; my $unit_id = $dbh->selectrow_array("select id from units where name = ?",undef,$u); From ee3f3500f73d2c1f9c4633147226dff5dc2563ca Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 28 Mar 2023 12:56:11 +0100 Subject: [PATCH 202/212] ECC-1559: GRIB encoding: data quality checks should test if shortName=unknown --- src/grib_util.cc | 12 ++++++++++-- tests/grib_data_quality_checks.sh | 17 +++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/grib_util.cc b/src/grib_util.cc index 2b8735650..dc3bc8cb7 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -2141,8 +2141,9 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max grib_context* ctx = h->context; bool is_error = true; char description[1024] = {0,}; - char step[32] = "unknown"; - size_t len = 32; + char step[32] = "unknown"; + char shortName[32] = {0,}; + size_t len = 32; // If grib_data_quality_checks == 1, limits failure results in an error // If grib_data_quality_checks == 2, limits failure results in a warning @@ -2150,6 +2151,13 @@ int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max Assert(ctx->grib_data_quality_checks == 1 || ctx->grib_data_quality_checks == 2); is_error = (ctx->grib_data_quality_checks == 1); + err = grib_get_string(h, "shortName", shortName, &len); + if (err || STR_EQUAL(shortName, "unknown")) { + fprintf(stderr, "ECCODES %s : Invalid metadata: shortName=unknown\n", + (is_error ? "ERROR" : "WARNING")); + if (is_error) return GRIB_INVALID_MESSAGE; + } + // The limit keys must exist if we are here err = grib_get_double(h, "param_value_min", &min_field_value_allowed); if (err) { diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index 6a6177cfd..4123a2785 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -200,13 +200,26 @@ unset ECCODES_EXTRA_DEFINITION_PATH # Check CCSDS encoding too # ------------------------- +if [ $HAVE_AEC -eq 1 ]; then + export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 + set +e + ${tools_dir}/grib_set -s scaleValuesBy=1000 $sample_ccsds $tempGrib2 2>$tempErr + status=$? + set -e + [ $status -ne 0 ] +fi + +# Invalid shortName export ECCODES_GRIB_DATA_QUALITY_CHECKS=1 +input2=${data_dir}/reduced_gaussian_surface.grib2 +${tools_dir}/grib_set -s discipline=254 $input2 $tempOut +grib_check_key_equals $tempOut 'shortName' 'unknown' set +e -${tools_dir}/grib_set -s scaleValuesBy=1000 $sample_ccsds $tempGrib2 2>$tempErr +${tools_dir}/grib_set -s scaleValuesBy=2 $tempOut $tempGrib2 2>$tempErr status=$? set -e [ $status -ne 0 ] - +grep -q "Invalid metadata: shortName=unknown" $tempErr # Clean up rm -rf $tempDir From 179a1ad2e016b4057cd3055f3bee3343d2e357b7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 28 Mar 2023 17:56:26 +0100 Subject: [PATCH 203/212] Tools: Use the key angleSubdivisions --- tools/grib_check_gaussian_grid.cc | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/tools/grib_check_gaussian_grid.cc b/tools/grib_check_gaussian_grid.cc index aea038b3b..9a3aea661 100644 --- a/tools/grib_check_gaussian_grid.cc +++ b/tools/grib_check_gaussian_grid.cc @@ -16,7 +16,6 @@ */ #include #include -#include #include #include @@ -64,16 +63,6 @@ static void error(const char* filename, int msg_num, const char* fmt, ...) } } -static double get_precision(long edition) -{ - if (edition == 1) - return 1.0 / 1000.0; /* milli degrees */ - if (edition == 2) - return 1.0 / 1000000.0; /* micro degrees */ - assert(!"Invalid edition"); - return 0.0; -} - static int process_file(const char* filename) { int err = 0, msg_num = 0; @@ -97,7 +86,7 @@ static int process_file(const char* filename) while ((h = grib_handle_new_from_file(0, in, &err)) != NULL) { int is_reduced_gaussian = 0, is_regular_gaussian = 0, grid_ok = 0; - long edition = 0, N = 0, Nj = 0, numberOfDataPoints, numberOfValues; + long edition = 0, N = 0, Nj = 0, numberOfDataPoints, numberOfValues, angleSubdivisions; size_t len = 0, sizeOfValuesArray = 0; double* lats = NULL; long* pl = NULL; @@ -134,7 +123,10 @@ static int process_file(const char* filename) GRIB_CHECK(grib_get_double(h, "latitudeOfLastGridPointInDegrees", &lat2), 0); GRIB_CHECK(grib_get_double(h, "longitudeOfLastGridPointInDegrees", &lon2), 0); - angular_tolerance = get_precision(edition); + GRIB_CHECK(grib_get_long(h, "angleSubdivisions", &angleSubdivisions), 0); + Assert(angleSubdivisions > 0); + angular_tolerance = 1.0/angleSubdivisions; + printf(" angular_tolerance=%g\n",angular_tolerance); if (N <= 0) { error(filename, msg_num, "N should be > 0\n", N); @@ -174,9 +166,9 @@ static int process_file(const char* filename) long iDirectionIncrementGiven = 0; is_missing_Ni = grib_is_missing(h, "Ni", &err); - assert(err == GRIB_SUCCESS); + Assert(err == GRIB_SUCCESS); is_missing_Di = grib_is_missing(h, "iDirectionIncrement", &err); - assert(err == GRIB_SUCCESS); + Assert(err == GRIB_SUCCESS); GRIB_CHECK(grib_get_long(h, "iDirectionIncrementGiven", &iDirectionIncrementGiven), 0); if (iDirectionIncrementGiven) { error(filename, msg_num, "For a reduced grid, iDirectionIncrementGiven should be 0\n"); @@ -189,12 +181,12 @@ static int process_file(const char* filename) } GRIB_CHECK(grib_get_size(h, "pl", &pl_len), 0); - assert(pl_len > 0); + Assert(pl_len > 0); if (pl_len != (size_t)(2 * N)) { error(filename, msg_num, "Length of pl array is %ld but should be 2*N (%ld)\n", pl_len, 2 * N); } pl = (long*)malloc(pl_len * sizeof(long)); - assert(pl); + Assert(pl); GRIB_CHECK(grib_get_long_array(h, "pl", pl, &pl_len), 0); max_pl = pl[0]; From 7ed9ed728807b8255feac685ec3e1d3040e3f8f7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Mar 2023 11:53:07 +0000 Subject: [PATCH 204/212] Scripts: Improve sanity checking --- definitions/add_params_from_tsv.pl | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/definitions/add_params_from_tsv.pl b/definitions/add_params_from_tsv.pl index 6be601f53..6aa471bd4 100755 --- a/definitions/add_params_from_tsv.pl +++ b/definitions/add_params_from_tsv.pl @@ -109,48 +109,53 @@ print "Checking sanity: uniqueness of paramId and shortName keys ...\n"; while (<>) { chomp; + $lcount++; s/\r//g; # Remove DOS carriage returns if ($first == 1) { $first = 0; next; } - $lcount++; + ($paramId, $shortName, $name, $units) = split(/\t/); - die "Error: shortName=$shortName is duplicated (line ", $lcount+1, ")\n" if (exists $map_sn{$shortName}); + die "Error: shortName=$shortName is duplicated (line $lcount)\n" if (exists $map_sn{$shortName}); $map_sn{$shortName}++; # increment count in shortName map - die "Error: paramId=$paramId is duplicated (line ", $lcount+1, ")\n" if (exists $map_pid{$paramId}); + die "Error: paramId=$paramId is duplicated (line $lcount)\n" if (exists $map_pid{$paramId}); $map_pid{$paramId}++; # increment count in paramId map if (!is_integer($paramId)) { - warn "Error: paramId=$paramId is not an integer (line ", $lcount+1, ")\n" ; + warn "Error: paramId=$paramId is not an integer (line $lcount)\n"; $sanity_error_count++; } my $x = $dbh->selectrow_array("select * from param.param where id = ?",undef,$paramId); if (defined $x) { - warn "Error: paramId=$x exists in the database (line ", $lcount+1, ")\n"; + warn "Error: paramId=$x exists in the database (line $lcount)\n"; $sanity_error_count++; } if ($name =~ / $/) { - die "Error: Name '$name': ends in space" ; + warn "Error: Name '$name': ends in space" ; $sanity_error_count++; } if ($name =~ /^ /) { - die "Error: Name '$name': starts with space" ; + warn "Error: Name '$name': starts with space" ; + $sanity_error_count++; + } + if ($name !~ /^[A-Z0-9]/) { + warn "Error: name \"$name\" should have uppercase 1st letter or digit (line $lcount)\n"; $sanity_error_count++; } $x = $dbh->selectrow_array("select shortName from param.param where shortName = ?",undef,$shortName); if (defined $x) { - warn "Error: shortName=$x exists in the database (line ", $lcount+1, ")\n"; + warn "Error: shortName=$x exists in the database (line $lcount)\n"; $sanity_error_count++; } if (!check_units($units)) { - warn "Error: Database does not contain units=$units (line ", $lcount+1, ")\n"; + warn "Error: Database does not contain units=$units (line $lcount)\n"; $sanity_error_count++; } } From bd52e0cbe8dea9d07dd9b49739e108ec46331155 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Mar 2023 12:07:54 +0000 Subject: [PATCH 205/212] ECC-1558: GRIB2: Add new ocean parameters --- definitions/grib2/cfVarName.def | 1182 +++++++++++++++++++++++++++- definitions/grib2/name.def | 1182 +++++++++++++++++++++++++++- definitions/grib2/paramId.def | 1182 +++++++++++++++++++++++++++- definitions/grib2/shortName.def | 1182 +++++++++++++++++++++++++++- definitions/grib2/units.def | 1280 ++++++++++++++++++++++++++++--- 5 files changed, 5754 insertions(+), 254 deletions(-) diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index 41a071d57..bb993680a 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -3660,6 +3660,162 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice volume per unit area +'sivol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow volume over sea ice per unit area +'snvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature +'sitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow temperature over sea ice +'sntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature at the sea ice and snow interface +'sisntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Underside ice temperature +'usitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice heat content +'sihc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow heat content over sea ice +'snhc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice freeboard thickness +'sifbr' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Sea ice melt pond fraction +'sipf' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond depth +'sipd' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond volume per unit area +'sipvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice fraction tendency due to parameterization +'bckinsic' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea surface salinity 'sos' = { discipline = 10 ; @@ -4008,6 +4164,174 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Bottom pressure equivalent height +'btp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Net surface upward water flux +'swfup' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux into sea water (from rivers) +'fw2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux into sea water +'vsf2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat flux correction +'hfcorr' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux correction +'fwcorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux correction +'vsfcorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Turbocline depth (kz=5e-4) +'turbocl' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Y-component of surface sea water velocity +'svy' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#X-component of surface sea water velocity +'svx' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward surface sea water velocity +'svn' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward surface sea water velocity +'sve' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat Content surface to 26C isotherm +'hct26' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + } +#Sea surface height tendency due to parameterization +'bckineta' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'so' = { discipline = 10 ; @@ -4072,13 +4396,197 @@ typeOfFirstFixedSurface = 168 ; typeOfSecondFixedSurface = 168 ; } -#Time-mean sea ice thickness -'avg_sithick' = { +#Sea water potential temperature tendency due to newtonian relaxation +'thetaodmp' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to newtonian relaxation +'sodmp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to parameterization +'bckint' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to parameterization +'bckins' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Eastward sea water velocity tendency due to parameterization +'bckine' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Northward sea water velocity tendency due to parameterization +'bckinn' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to direct bias correction +'tdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to direct bias correction +'sdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Net short wave radiation rate at sea surface +'ssr_sea' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind stress at 10m above sea surface +'wst10_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind speed at 10m above sea surface +'ws10_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Neutral drag coefficient at 10m above sea surface +'nd10_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Total precipitation rate at sea surface +'tprate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow precipitation rate at sea surface +'snrate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward of wind stress over sea ice +'ewst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward of wind stress over sea ice +'nwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#U-component of wind stress over sea ice +'uwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#V-component of wind stress over sea ice +'vwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Time-mean sea ice thickness +'avg_sithick' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; scaledValueOfSecondFixedSurface = missing() ; @@ -4163,6 +4671,175 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice volume per unit area +'avg_sivol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow volume over sea ice per unit area +'avg_snvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature +'avg_sitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow temperature over sea ice +'avg_sntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature at the sea ice and snow interface +'avg_sisntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean underside ice temperature +'avg_usitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice heat content +'avg_sihc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow heat content over sea ice +'avg_snhc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice freeboard thickness +'avg_sifbr' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond fraction +'avg_sipf' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond depth +'avg_sipd' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond volume per unit area +'avg_sipvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice fraction tendency due to parameterization +'avg_bckinsic' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface salinity 'avg_sos' = { discipline = 10 ; @@ -4429,57 +5106,226 @@ parameterCategory = 4 ; parameterNumber = 21 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 300 m +'avg_hc300m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 700 m +'avg_hc700m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column heat content +'avg_hcbtm' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height +'avg_zos' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean steric change in sea surface height +'avg_stheig' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean halosteric change in sea surface height +'avg_hstheig' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 10 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermosteric change in sea surface height +'avg_tstheig' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermocline depth +'avg_thcline' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean bottom pressure equivalent height +'avg_btp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net surface upward water flux +'avg_swfup' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fresh water flux into sea water (from rivers) +'avg_fw2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean virtual salt flux into sea water +'avg_vsf2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean heat flux correction +'avg_hfcorr' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 300 m -'avg_hc300m' = { +#Time-mean fresh water flux correction +'avg_fwcorr' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 31 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 300 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 700 m -'avg_hc700m' = { +#Time-mean virtual salt flux correction +'avg_vsfcorr' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 33 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 700 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean total column heat content -'avg_hcbtm' = { +#Time-mean turbocline depth (kz=5e-4) +'avg_turbocl' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea surface height -'avg_zos' = { +#Time-mean Y-component of surface sea water velocity +'avg_svy' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 1 ; + parameterNumber = 17 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4488,11 +5334,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean steric change in sea surface height -'avg_stheig' = { +#Time-mean X-component of surface sea water velocity +'avg_svx' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 11 ; + parameterNumber = 16 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4501,11 +5347,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean halosteric change in sea surface height -'avg_hstheig' = { +#Time-mean northward surface sea water velocity +'avg_svn' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 10 ; + parameterNumber = 15 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4514,11 +5360,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermosteric change in sea surface height -'avg_tstheig' = { +#Time-mean eastward surface sea water velocity +'avg_sve' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 9 ; + parameterNumber = 14 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4527,11 +5373,24 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermocline depth -'avg_thcline' = { +#Time-mean heat content surface to 26C isotherm +'avg_hct26' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 0 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height tendency due to parameterization +'avg_bckineta' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4612,6 +5471,247 @@ typeOfSecondFixedSurface = 168 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea water potential temperature tendency due to newtonian relaxation +'avg_thetaodmp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to newtonian relaxation +'avg_sodmp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to parameterization +'avg_bckint' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to parameterization +'avg_bckins' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward sea water velocity tendency due to parameterization +'avg_bckine' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward sea water velocity tendency due to parameterization +'avg_bckinn' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to direct bias correction +'avg_tdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to direct bias correction +'avg_sdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net short wave radiation rate at sea surface +'avg_ssr_sea' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind stress at 10m above sea surface +'avg_10wst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind speed at 10m above sea surface +'avg_10ws_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean neutral drag coefficient at 10m above sea surface +'avg_10nd_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total precipitation rate at sea surface +'avg_tprate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow precipitation rate at sea surface +'avg_snrate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward of wind stress over sea ice +'avg_ewst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward of wind stress over sea ice +'avg_nwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean U-component of wind stress over sea ice +'avg_uwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean V-component of wind stress over sea ice +'avg_vwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-accumulated net short wave radiation at sea surface +'acc_ssr_sea' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated total precipitation at sea surface +'tp_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated snow precipitation at sea surface +'sn_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } #Virtual temperature 'vtmp' = { discipline = 0 ; diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index a149ebdeb..3c6d23577 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -3660,6 +3660,162 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice volume per unit area +'Sea ice volume per unit area' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow volume over sea ice per unit area +'Snow volume over sea ice per unit area' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature +'Sea ice temperature' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow temperature over sea ice +'Snow temperature over sea ice' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature at the sea ice and snow interface +'Sea ice temperature at the sea ice and snow interface' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Underside ice temperature +'Underside ice temperature' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice heat content +'Sea ice heat content' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow heat content over sea ice +'Snow heat content over sea ice' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice freeboard thickness +'Sea ice freeboard thickness' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Sea ice melt pond fraction +'Sea ice melt pond fraction' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond depth +'Sea ice melt pond depth' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond volume per unit area +'Sea ice melt pond volume per unit area' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice fraction tendency due to parameterization +'Sea ice fraction tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea surface salinity 'Sea surface salinity' = { discipline = 10 ; @@ -4008,6 +4164,174 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Bottom pressure equivalent height +'Bottom pressure equivalent height' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Net surface upward water flux +'Net surface upward water flux' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux into sea water (from rivers) +'Fresh water flux into sea water (from rivers)' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux into sea water +'Virtual salt flux into sea water' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat flux correction +'Heat flux correction' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux correction +'Fresh water flux correction' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux correction +'Virtual salt flux correction' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Turbocline depth (kz=5e-4) +'Turbocline depth (kz=5e-4)' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Y-component of surface sea water velocity +'Y-component of surface sea water velocity' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#X-component of surface sea water velocity +'X-component of surface sea water velocity' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward surface sea water velocity +'Northward surface sea water velocity' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward surface sea water velocity +'Eastward surface sea water velocity' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat Content surface to 26C isotherm +'Heat Content surface to 26C isotherm' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + } +#Sea surface height tendency due to parameterization +'Sea surface height tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'Sea water practical salinity' = { discipline = 10 ; @@ -4072,13 +4396,197 @@ typeOfFirstFixedSurface = 168 ; typeOfSecondFixedSurface = 168 ; } -#Time-mean sea ice thickness -'Time-mean sea ice thickness' = { +#Sea water potential temperature tendency due to newtonian relaxation +'Sea water potential temperature tendency due to newtonian relaxation' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to newtonian relaxation +'Sea water salinity tendency due to newtonian relaxation' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to parameterization +'Sea water temperature tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to parameterization +'Sea water salinity tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Eastward sea water velocity tendency due to parameterization +'Eastward sea water velocity tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Northward sea water velocity tendency due to parameterization +'Northward sea water velocity tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to direct bias correction +'Sea water temperature tendency due to direct bias correction' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to direct bias correction +'Sea water salinity tendency due to direct bias correction' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Net short wave radiation rate at sea surface +'Net short wave radiation rate at sea surface' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind stress at 10m above sea surface +'Wind stress at 10m above sea surface' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind speed at 10m above sea surface +'Wind speed at 10m above sea surface' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Neutral drag coefficient at 10m above sea surface +'Neutral drag coefficient at 10m above sea surface' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Total precipitation rate at sea surface +'Total precipitation rate at sea surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow precipitation rate at sea surface +'Snow precipitation rate at sea surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward of wind stress over sea ice +'Eastward of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward of wind stress over sea ice +'Northward of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#U-component of wind stress over sea ice +'U-component of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#V-component of wind stress over sea ice +'V-component of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Time-mean sea ice thickness +'Time-mean sea ice thickness' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; scaledValueOfSecondFixedSurface = missing() ; @@ -4163,6 +4671,175 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice volume per unit area +'Time-mean sea ice volume per unit area' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow volume over sea ice per unit area +'Time-mean snow volume over sea ice per unit area' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature +'Time-mean sea ice temperature' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow temperature over sea ice +'Time-mean snow temperature over sea ice' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature at the sea ice and snow interface +'Time-mean sea ice temperature at the sea ice and snow interface' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean underside ice temperature +'Time-mean underside ice temperature' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice heat content +'Time-mean sea ice heat content' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow heat content over sea ice +'Time-mean snow heat content over sea ice' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice freeboard thickness +'Time-mean sea ice freeboard thickness' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond fraction +'Time-mean sea ice melt pond fraction' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond depth +'Time-mean sea ice melt pond depth' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond volume per unit area +'Time-mean sea ice melt pond volume per unit area' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice fraction tendency due to parameterization +'Time-mean sea ice fraction tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface salinity 'Time-mean sea surface salinity' = { discipline = 10 ; @@ -4429,57 +5106,226 @@ parameterCategory = 4 ; parameterNumber = 21 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 300 m +'Time-mean vertically-integrated heat content in the upper 300 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 700 m +'Time-mean vertically-integrated heat content in the upper 700 m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column heat content +'Time-mean total column heat content' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height +'Time-mean sea surface height' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean steric change in sea surface height +'Time-mean steric change in sea surface height' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean halosteric change in sea surface height +'Time-mean halosteric change in sea surface height' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 10 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermosteric change in sea surface height +'Time-mean thermosteric change in sea surface height' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermocline depth +'Time-mean thermocline depth' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean bottom pressure equivalent height +'Time-mean bottom pressure equivalent height' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net surface upward water flux +'Time-mean net surface upward water flux' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fresh water flux into sea water (from rivers) +'Time-mean fresh water flux into sea water (from rivers)' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean virtual salt flux into sea water +'Time-mean virtual salt flux into sea water' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean heat flux correction +'Time-mean heat flux correction' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 300 m -'Time-mean vertically-integrated heat content in the upper 300 m' = { +#Time-mean fresh water flux correction +'Time-mean fresh water flux correction' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 31 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 300 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 700 m -'Time-mean vertically-integrated heat content in the upper 700 m' = { +#Time-mean virtual salt flux correction +'Time-mean virtual salt flux correction' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 33 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 700 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean total column heat content -'Time-mean total column heat content' = { +#Time-mean turbocline depth (kz=5e-4) +'Time-mean turbocline depth (kz=5e-4)' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea surface height -'Time-mean sea surface height' = { +#Time-mean Y-component of surface sea water velocity +'Time-mean Y-component of surface sea water velocity' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 1 ; + parameterNumber = 17 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4488,11 +5334,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean steric change in sea surface height -'Time-mean steric change in sea surface height' = { +#Time-mean X-component of surface sea water velocity +'Time-mean X-component of surface sea water velocity' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 11 ; + parameterNumber = 16 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4501,11 +5347,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean halosteric change in sea surface height -'Time-mean halosteric change in sea surface height' = { +#Time-mean northward surface sea water velocity +'Time-mean northward surface sea water velocity' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 10 ; + parameterNumber = 15 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4514,11 +5360,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermosteric change in sea surface height -'Time-mean thermosteric change in sea surface height' = { +#Time-mean eastward surface sea water velocity +'Time-mean eastward surface sea water velocity' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 9 ; + parameterNumber = 14 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4527,11 +5373,24 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermocline depth -'Time-mean thermocline depth' = { +#Time-mean heat content surface to 26C isotherm +'Time-mean heat content surface to 26C isotherm' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 0 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height tendency due to parameterization +'Time-mean sea surface height tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4612,6 +5471,247 @@ typeOfSecondFixedSurface = 168 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea water potential temperature tendency due to newtonian relaxation +'Time-mean sea water potential temperature tendency due to newtonian relaxation' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to newtonian relaxation +'Time-mean sea water salinity tendency due to newtonian relaxation' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to parameterization +'Time-mean sea water temperature tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to parameterization +'Time-mean sea water salinity tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward sea water velocity tendency due to parameterization +'Time-mean eastward sea water velocity tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward sea water velocity tendency due to parameterization +'Time-mean northward sea water velocity tendency due to parameterization' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to direct bias correction +'Time-mean sea water temperature tendency due to direct bias correction' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to direct bias correction +'Time-mean sea water salinity tendency due to direct bias correction' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net short wave radiation rate at sea surface +'Time-mean net short wave radiation rate at sea surface' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind stress at 10m above sea surface +'Time-mean wind stress at 10m above sea surface' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind speed at 10m above sea surface +'Time-mean wind speed at 10m above sea surface' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean neutral drag coefficient at 10m above sea surface +'Time-mean neutral drag coefficient at 10m above sea surface' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total precipitation rate at sea surface +'Time-mean total precipitation rate at sea surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow precipitation rate at sea surface +'Time-mean snow precipitation rate at sea surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward of wind stress over sea ice +'Time-mean eastward of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward of wind stress over sea ice +'Time-mean northward of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean U-component of wind stress over sea ice +'Time-mean U-component of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean V-component of wind stress over sea ice +'Time-mean V-component of wind stress over sea ice' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-accumulated net short wave radiation at sea surface +'Time-accumulated net short wave radiation at sea surface' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated total precipitation at sea surface +'Time-accumulated total precipitation at sea surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated snow precipitation at sea surface +'Time-accumulated snow precipitation at sea surface' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } #Virtual temperature 'Virtual temperature' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 7990000eb..6965f3ad0 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -3660,6 +3660,162 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice volume per unit area +'262008' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow volume over sea ice per unit area +'262009' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature +'262010' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow temperature over sea ice +'262011' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature at the sea ice and snow interface +'262012' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Underside ice temperature +'262013' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice heat content +'262014' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow heat content over sea ice +'262015' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice freeboard thickness +'262016' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Sea ice melt pond fraction +'262017' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond depth +'262018' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond volume per unit area +'262019' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice fraction tendency due to parameterization +'262020' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea surface salinity '262100' = { discipline = 10 ; @@ -4008,6 +4164,174 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Bottom pressure equivalent height +'262129' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Net surface upward water flux +'262130' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux into sea water (from rivers) +'262131' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux into sea water +'262132' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat flux correction +'262133' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux correction +'262134' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux correction +'262135' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Turbocline depth (kz=5e-4) +'262136' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Y-component of surface sea water velocity +'262137' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#X-component of surface sea water velocity +'262138' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward surface sea water velocity +'262139' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward surface sea water velocity +'262140' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat Content surface to 26C isotherm +'262141' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + } +#Sea surface height tendency due to parameterization +'262142' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity '262500' = { discipline = 10 ; @@ -4072,13 +4396,197 @@ typeOfFirstFixedSurface = 168 ; typeOfSecondFixedSurface = 168 ; } -#Time-mean sea ice thickness -'263000' = { +#Sea water potential temperature tendency due to newtonian relaxation +'262508' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to newtonian relaxation +'262509' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to parameterization +'262510' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to parameterization +'262511' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Eastward sea water velocity tendency due to parameterization +'262512' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Northward sea water velocity tendency due to parameterization +'262513' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to direct bias correction +'262514' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to direct bias correction +'262515' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Net short wave radiation rate at sea surface +'262900' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind stress at 10m above sea surface +'262901' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind speed at 10m above sea surface +'262902' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Neutral drag coefficient at 10m above sea surface +'262903' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Total precipitation rate at sea surface +'262904' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow precipitation rate at sea surface +'262905' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward of wind stress over sea ice +'262906' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward of wind stress over sea ice +'262907' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#U-component of wind stress over sea ice +'262908' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#V-component of wind stress over sea ice +'262909' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Time-mean sea ice thickness +'263000' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; scaledValueOfSecondFixedSurface = missing() ; @@ -4163,6 +4671,175 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice volume per unit area +'263008' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow volume over sea ice per unit area +'263009' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature +'263010' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow temperature over sea ice +'263011' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature at the sea ice and snow interface +'263012' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean underside ice temperature +'263013' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice heat content +'263014' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow heat content over sea ice +'263015' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice freeboard thickness +'263016' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond fraction +'263017' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond depth +'263018' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond volume per unit area +'263019' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice fraction tendency due to parameterization +'263020' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface salinity '263100' = { discipline = 10 ; @@ -4429,57 +5106,226 @@ parameterCategory = 4 ; parameterNumber = 21 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 300 m +'263121' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 700 m +'263122' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column heat content +'263123' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height +'263124' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean steric change in sea surface height +'263125' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean halosteric change in sea surface height +'263126' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 10 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermosteric change in sea surface height +'263127' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermocline depth +'263128' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean bottom pressure equivalent height +'263129' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net surface upward water flux +'263130' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fresh water flux into sea water (from rivers) +'263131' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean virtual salt flux into sea water +'263132' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean heat flux correction +'263133' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 300 m -'263121' = { +#Time-mean fresh water flux correction +'263134' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 31 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 300 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 700 m -'263122' = { +#Time-mean virtual salt flux correction +'263135' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 33 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 700 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean total column heat content -'263123' = { +#Time-mean turbocline depth (kz=5e-4) +'263136' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea surface height -'263124' = { +#Time-mean Y-component of surface sea water velocity +'263137' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 1 ; + parameterNumber = 17 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4488,11 +5334,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean steric change in sea surface height -'263125' = { +#Time-mean X-component of surface sea water velocity +'263138' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 11 ; + parameterNumber = 16 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4501,11 +5347,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean halosteric change in sea surface height -'263126' = { +#Time-mean northward surface sea water velocity +'263139' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 10 ; + parameterNumber = 15 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4514,11 +5360,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermosteric change in sea surface height -'263127' = { +#Time-mean eastward surface sea water velocity +'263140' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 9 ; + parameterNumber = 14 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4527,11 +5373,24 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermocline depth -'263128' = { +#Time-mean heat content surface to 26C isotherm +'263141' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 0 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height tendency due to parameterization +'263142' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4612,6 +5471,247 @@ typeOfSecondFixedSurface = 168 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea water potential temperature tendency due to newtonian relaxation +'263508' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to newtonian relaxation +'263509' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to parameterization +'263510' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to parameterization +'263511' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward sea water velocity tendency due to parameterization +'263512' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward sea water velocity tendency due to parameterization +'263513' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to direct bias correction +'263514' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to direct bias correction +'263515' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net short wave radiation rate at sea surface +'263900' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind stress at 10m above sea surface +'263901' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind speed at 10m above sea surface +'263902' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean neutral drag coefficient at 10m above sea surface +'263903' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total precipitation rate at sea surface +'263904' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow precipitation rate at sea surface +'263905' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward of wind stress over sea ice +'263906' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward of wind stress over sea ice +'263907' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean U-component of wind stress over sea ice +'263908' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean V-component of wind stress over sea ice +'263909' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-accumulated net short wave radiation at sea surface +'264900' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated total precipitation at sea surface +'264904' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated snow precipitation at sea surface +'264905' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } #Virtual temperature '300012' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index 13da2dbe5..de493f2fe 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -3660,6 +3660,162 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice volume per unit area +'sivol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow volume over sea ice per unit area +'snvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature +'sitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow temperature over sea ice +'sntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature at the sea ice and snow interface +'sisntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Underside ice temperature +'usitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice heat content +'sihc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow heat content over sea ice +'snhc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice freeboard thickness +'sifbr' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Sea ice melt pond fraction +'sipf' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond depth +'sipd' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond volume per unit area +'sipvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice fraction tendency due to parameterization +'bckinsic' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea surface salinity 'sos' = { discipline = 10 ; @@ -4008,6 +4164,174 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Bottom pressure equivalent height +'btp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Net surface upward water flux +'swfup' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux into sea water (from rivers) +'fw2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux into sea water +'vsf2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat flux correction +'hfcorr' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Fresh water flux correction +'fwcorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Virtual salt flux correction +'vsfcorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Turbocline depth (kz=5e-4) +'turbocl' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Y-component of surface sea water velocity +'svy' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#X-component of surface sea water velocity +'svx' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward surface sea water velocity +'svn' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward surface sea water velocity +'sve' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat Content surface to 26C isotherm +'hct26' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + } +#Sea surface height tendency due to parameterization +'bckineta' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea water practical salinity 'so' = { discipline = 10 ; @@ -4072,13 +4396,197 @@ typeOfFirstFixedSurface = 168 ; typeOfSecondFixedSurface = 168 ; } -#Time-mean sea ice thickness -'avg_sithick' = { +#Sea water potential temperature tendency due to newtonian relaxation +'thetaodmp' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to newtonian relaxation +'sodmp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to parameterization +'bckint' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to parameterization +'bckins' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Eastward sea water velocity tendency due to parameterization +'bckine' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Northward sea water velocity tendency due to parameterization +'bckinn' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to direct bias correction +'tdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to direct bias correction +'sdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Net short wave radiation rate at sea surface +'ssr_sea' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind stress at 10m above sea surface +'10wst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind speed at 10m above sea surface +'10ws_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Neutral drag coefficient at 10m above sea surface +'10nd_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Total precipitation rate at sea surface +'tprate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow precipitation rate at sea surface +'snrate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward of wind stress over sea ice +'ewst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward of wind stress over sea ice +'nwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#U-component of wind stress over sea ice +'uwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#V-component of wind stress over sea ice +'vwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Time-mean sea ice thickness +'avg_sithick' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; scaledValueOfSecondFixedSurface = missing() ; @@ -4163,6 +4671,175 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice volume per unit area +'avg_sivol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow volume over sea ice per unit area +'avg_snvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature +'avg_sitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow temperature over sea ice +'avg_sntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature at the sea ice and snow interface +'avg_sisntemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean underside ice temperature +'avg_usitemp' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice heat content +'avg_sihc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow heat content over sea ice +'avg_snhc' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice freeboard thickness +'avg_sifbr' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond fraction +'avg_sipf' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond depth +'avg_sipd' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond volume per unit area +'avg_sipvol' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice fraction tendency due to parameterization +'avg_bckinsic' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface salinity 'avg_sos' = { discipline = 10 ; @@ -4429,57 +5106,226 @@ parameterCategory = 4 ; parameterNumber = 21 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 300 m +'avg_hc300m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 300 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean vertically-integrated heat content in the upper 700 m +'avg_hc700m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 700 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total column heat content +'avg_hcbtm' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height +'avg_zos' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean steric change in sea surface height +'avg_stheig' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean halosteric change in sea surface height +'avg_hstheig' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 10 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermosteric change in sea surface height +'avg_tstheig' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermocline depth +'avg_thcline' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean bottom pressure equivalent height +'avg_btp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net surface upward water flux +'avg_swfup' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fresh water flux into sea water (from rivers) +'avg_fw2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean virtual salt flux into sea water +'avg_vsf2sw' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean heat flux correction +'avg_hfcorr' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 300 m -'avg_hc300m' = { +#Time-mean fresh water flux correction +'avg_fwcorr' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 31 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 300 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean vertically-integrated heat content in the upper 700 m -'avg_hc700m' = { +#Time-mean virtual salt flux correction +'avg_vsfcorr' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; + parameterNumber = 33 ; typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; scaleFactorOfFirstFixedSurface = 0 ; - scaledValueOfSecondFixedSurface = 700 ; - scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean total column heat content -'avg_hcbtm' = { +#Time-mean turbocline depth (kz=5e-4) +'avg_turbocl' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 22 ; - typeOfFirstFixedSurface = 160 ; - typeOfSecondFixedSurface = 9 ; - scaledValueOfFirstFixedSurface = 0 ; - scaleFactorOfFirstFixedSurface = 0 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea surface height -'avg_zos' = { +#Time-mean Y-component of surface sea water velocity +'avg_svy' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 1 ; + parameterNumber = 17 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4488,11 +5334,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean steric change in sea surface height -'avg_stheig' = { +#Time-mean X-component of surface sea water velocity +'avg_svx' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 11 ; + parameterNumber = 16 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4501,11 +5347,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean halosteric change in sea surface height -'avg_hstheig' = { +#Time-mean northward surface sea water velocity +'avg_svn' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 10 ; + parameterNumber = 15 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4514,11 +5360,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermosteric change in sea surface height -'avg_tstheig' = { +#Time-mean eastward surface sea water velocity +'avg_sve' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 9 ; + parameterNumber = 14 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4527,11 +5373,24 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermocline depth -'avg_thcline' = { +#Time-mean heat content surface to 26C isotherm +'avg_hct26' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 0 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height tendency due to parameterization +'avg_bckineta' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4612,6 +5471,247 @@ typeOfSecondFixedSurface = 168 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea water potential temperature tendency due to newtonian relaxation +'avg_thetaodmp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to newtonian relaxation +'avg_sodmp' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to parameterization +'avg_bckint' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to parameterization +'avg_bckins' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward sea water velocity tendency due to parameterization +'avg_bckine' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward sea water velocity tendency due to parameterization +'avg_bckinn' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to direct bias correction +'avg_tdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to direct bias correction +'avg_sdbiascorr' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net short wave radiation rate at sea surface +'avg_ssr_sea' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind stress at 10m above sea surface +'avg_10wst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind speed at 10m above sea surface +'avg_10ws_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean neutral drag coefficient at 10m above sea surface +'avg_10nd_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total precipitation rate at sea surface +'avg_tprate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow precipitation rate at sea surface +'avg_snrate_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward of wind stress over sea ice +'avg_ewst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward of wind stress over sea ice +'avg_nwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean U-component of wind stress over sea ice +'avg_uwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean V-component of wind stress over sea ice +'avg_vwst_sea' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-accumulated net short wave radiation at sea surface +'acc_ssr_sea' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated total precipitation at sea surface +'tp_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated snow precipitation at sea surface +'sn_sea' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } #Virtual temperature 'vtmp' = { discipline = 0 ; diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index b2bcfb68d..af0f728a6 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -3660,6 +3660,162 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice volume per unit area +'m**3 m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow volume over sea ice per unit area +'m**3 m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow temperature over sea ice +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice temperature at the sea ice and snow interface +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Underside ice temperature +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 176 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice heat content +'J m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow heat content over sea ice +'J m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice freeboard thickness +'m' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + } +#Sea ice melt pond fraction +'Proportion' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond depth +'m' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice melt pond volume per unit area +'m**3 m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea ice fraction tendency due to parameterization +'s**-1' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Sea surface salinity 'Numeric' = { discipline = 10 ; @@ -4008,102 +4164,506 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } -#Sea water practical salinity -'10**-3' = { - discipline = 10 ; - parameterCategory = 4 ; - parameterNumber = 21 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; - } -#Sea water potential temperature -'K' = { +#Bottom pressure equivalent height +'m' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 18 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#Sea water sigma theta -'kg m**-3' = { +#Net surface upward water flux +'kg m**-2 s**-1' = { discipline = 10 ; - parameterCategory = 4 ; - parameterNumber = 20 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#Y-component of sea water velocity -'m s**-1' = { +#Fresh water flux into sea water (from rivers) +'kg m**-2 s**-1' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 26 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#X-component of sea water velocity -'m s**-1' = { +#Virtual salt flux into sea water +'g kg**-1 m**-2 s**-1' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 25 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#Northward sea water velocity -'m s**-1' = { +#Heat flux correction +'W m**-2' = { discipline = 10 ; - parameterCategory = 4 ; - parameterNumber = 24 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#Eastward sea water velocity -'m s**-1' = { +#Fresh water flux correction +'kg m**-2 s**-1' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 23 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterNumber = 31 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#Upward sea water velocity -'m s**-1' = { +#Virtual salt flux correction +'g kg**-1 m**-2 s**-1' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 27 ; - typeOfFirstFixedSurface = 168 ; - typeOfSecondFixedSurface = 168 ; + parameterNumber = 33 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; } -#Time-mean sea ice thickness +#Turbocline depth (kz=5e-4) 'm' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 1 ; - typeOfFirstFixedSurface = 174 ; - typeOfSecondFixedSurface = 176 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; + parameterCategory = 4 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; - typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice area fraction -'Fraction' = { +#Y-component of surface sea water velocity +'m s**-1' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 0 ; - typeOfFirstFixedSurface = 174 ; + parameterCategory = 3 ; + parameterNumber = 17 ; + typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; - scaledValueOfFirstFixedSurface = missing() ; - scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; - typeOfStatisticalProcessing = 0 ; } -#Time-mean X-component of sea ice velocity +#X-component of surface sea water velocity 'm s**-1' = { discipline = 10 ; - parameterCategory = 2 ; - parameterNumber = 4 ; - typeOfFirstFixedSurface = 174 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward surface sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 15 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward surface sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Heat Content surface to 26C isotherm +'J m**-2' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + } +#Sea surface height tendency due to parameterization +'m s**-1' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Sea water practical salinity +'10**-3' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water potential temperature +'K' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water sigma theta +'kg m**-3' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Y-component of sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 26 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#X-component of sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 25 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Northward sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 24 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Eastward sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Upward sea water velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 27 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water potential temperature tendency due to newtonian relaxation +'K s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to newtonian relaxation +'g kg**-1 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to parameterization +'K s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to parameterization +'g kg**-1 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Eastward sea water velocity tendency due to parameterization +'m s**-2' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Northward sea water velocity tendency due to parameterization +'m s**-2' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water temperature tendency due to direct bias correction +'K s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Sea water salinity tendency due to direct bias correction +'g kg**-1 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + } +#Net short wave radiation rate at sea surface +'W m**-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind stress at 10m above sea surface +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Wind speed at 10m above sea surface +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Neutral drag coefficient at 10m above sea surface +'dimensionless' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Total precipitation rate at sea surface +'kg m**-2 s**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Snow precipitation rate at sea surface +'kg m**-2 s**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Eastward of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Northward of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#U-component of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#V-component of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } +#Time-mean sea ice thickness +'m' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice area fraction +'Fraction' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean X-component of sea ice velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean Y-component of sea ice velocity +'m s**-1' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 5 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice albedo +'Fraction' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice surface temperature +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice growth +'m s**-1' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 174 ; typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; @@ -4111,11 +4671,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean Y-component of sea ice velocity -'m s**-1' = { +#Time-mean sea ice volume per unit area +'m**3 m**-2' = { discipline = 10 ; parameterCategory = 2 ; - parameterNumber = 5 ; + parameterNumber = 15 ; typeOfFirstFixedSurface = 174 ; typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; @@ -4124,12 +4684,51 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice albedo -'Fraction' = { +#Time-mean snow volume over sea ice per unit area +'m**3 m**-2' = { discipline = 10 ; parameterCategory = 2 ; - parameterNumber = 14 ; + parameterNumber = 16 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 176 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow temperature over sea ice +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice temperature at the sea ice and snow interface +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 175 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; @@ -4137,12 +4736,12 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice surface temperature +#Time-mean underside ice temperature 'K' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; - typeOfFirstFixedSurface = 174 ; + typeOfFirstFixedSurface = 176 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = missing() ; scaleFactorOfFirstFixedSurface = missing() ; @@ -4150,11 +4749,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice growth -'m s**-1' = { +#Time-mean sea ice heat content +'J m**-2' = { discipline = 10 ; parameterCategory = 2 ; - parameterNumber = 6 ; + parameterNumber = 17 ; typeOfFirstFixedSurface = 174 ; typeOfSecondFixedSurface = 176 ; scaledValueOfFirstFixedSurface = missing() ; @@ -4163,6 +4762,84 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean snow heat content over sea ice +'J m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 173 ; + typeOfSecondFixedSurface = 175 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice freeboard thickness +'m' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 160 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = 0 ; + scaleFactorOfSecondFixedSurface = 0 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond fraction +'Proportion' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 20 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond depth +'m' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 21 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice melt pond volume per unit area +'m**3 m**-2' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 188 ; + typeOfSecondFixedSurface = 189 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea ice fraction tendency due to parameterization +'s**-1' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 23 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface salinity 'Numeric' = { discipline = 10 ; @@ -4475,11 +5152,180 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea surface height +#Time-mean sea surface height +'m' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean steric change in sea surface height +'m' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean halosteric change in sea surface height +'m' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 10 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermosteric change in sea surface height +'m' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean thermocline depth +'m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean bottom pressure equivalent height +'m' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 9 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net surface upward water flux +'kg m**-2 s**-1' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fresh water flux into sea water (from rivers) +'kg m**-2 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 30 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean virtual salt flux into sea water +'g kg**-1 m**-2 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 32 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean heat flux correction +'W m**-2' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean fresh water flux correction +'kg m**-2 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 31 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean virtual salt flux correction +'g kg**-1 m**-2 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 33 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean turbocline depth (kz=5e-4) 'm' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 14 ; + typeOfFirstFixedSurface = 171 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 5 ; + scaleFactorOfFirstFixedSurface = 4 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean Y-component of surface sea water velocity +'m s**-1' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 1 ; + parameterNumber = 17 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4488,11 +5334,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean steric change in sea surface height -'m' = { +#Time-mean X-component of surface sea water velocity +'m s**-1' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 11 ; + parameterNumber = 16 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4501,11 +5347,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean halosteric change in sea surface height -'m' = { +#Time-mean northward surface sea water velocity +'m s**-1' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 10 ; + parameterNumber = 15 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4514,11 +5360,11 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermosteric change in sea surface height -'m' = { +#Time-mean eastward surface sea water velocity +'m s**-1' = { discipline = 10 ; parameterCategory = 3 ; - parameterNumber = 9 ; + parameterNumber = 14 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4527,11 +5373,24 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean thermocline depth -'m' = { +#Time-mean heat content surface to 26C isotherm +'J m**-2' = { discipline = 10 ; parameterCategory = 4 ; - parameterNumber = 0 ; + parameterNumber = 22 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 20 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 29915 ; + scaleFactorOfSecondFixedSurface = 2 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea surface height tendency due to parameterization +'m s**-1' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 19 ; typeOfFirstFixedSurface = 160 ; typeOfSecondFixedSurface = 255 ; scaledValueOfFirstFixedSurface = 0 ; @@ -4612,6 +5471,247 @@ typeOfSecondFixedSurface = 168 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea water potential temperature tendency due to newtonian relaxation +'K s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 34 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to newtonian relaxation +'g kg**-1 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 35 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to parameterization +'K s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 36 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to parameterization +'g kg**-1 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 37 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward sea water velocity tendency due to parameterization +'m s**-2' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 38 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward sea water velocity tendency due to parameterization +'m s**-2' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 39 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water temperature tendency due to direct bias correction +'K s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean sea water salinity tendency due to direct bias correction +'g kg**-1 s**-1' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 168 ; + typeOfSecondFixedSurface = 168 ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean net short wave radiation rate at sea surface +'W m**-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind stress at 10m above sea surface +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 49 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean wind speed at 10m above sea surface +'m s**-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean neutral drag coefficient at 10m above sea surface +'dimensionless' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 29 ; + typeOfFirstFixedSurface = 102 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean total precipitation rate at sea surface +'kg m**-2 s**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean snow precipitation rate at sea surface +'kg m**-2 s**-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean eastward of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 50 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean northward of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 51 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean U-component of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-mean V-component of wind stress over sea ice +'N m**-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 53 ; + typeOfFirstFixedSurface = 174 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = missing() ; + scaleFactorOfFirstFixedSurface = missing() ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 0 ; + } +#Time-accumulated net short wave radiation at sea surface +'J m**-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 9 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated total precipitation at sea surface +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } +#Time-accumulated snow precipitation at sea surface +'kg m**-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 66 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + typeOfStatisticalProcessing = 1 ; + } #Virtual temperature 'K' = { discipline = 0 ; From ab18cc6ecfa2fe6b0e4a9c9262e51bf0e67bbbf2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Mar 2023 13:27:16 +0000 Subject: [PATCH 206/212] ECC-1561: GRIB2: Update some legacy ocean parameters (remove grib2 rep of 151149) --- definitions/grib2/localConcepts/ecmf/cfVarName.def | 6 ------ definitions/grib2/localConcepts/ecmf/name.def | 6 ------ definitions/grib2/localConcepts/ecmf/paramId.def | 6 ------ definitions/grib2/localConcepts/ecmf/shortName.def | 6 ------ definitions/grib2/localConcepts/ecmf/units.def | 6 ------ 5 files changed, 30 deletions(-) diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 5a6667f58..ba0d2e0fa 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -17069,12 +17069,6 @@ parameterCategory = 151 ; parameterNumber = 148 ; } -#Bottom Pressure (equivalent height) -'btp' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 149 ; - } #Steric height 'sh' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index bb408666d..31e0b0252 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -17069,12 +17069,6 @@ parameterCategory = 151 ; parameterNumber = 148 ; } -#Bottom Pressure (equivalent height) -'Bottom Pressure (equivalent height)' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 149 ; - } #Steric height 'Steric height' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index 43d93d582..c8e69dd65 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -17069,12 +17069,6 @@ parameterCategory = 151 ; parameterNumber = 148 ; } -#Bottom Pressure (equivalent height) -'151149' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 149 ; - } #Steric height '151150' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index 917c0fb33..95612eac9 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -17069,12 +17069,6 @@ parameterCategory = 151 ; parameterNumber = 148 ; } -#Bottom Pressure (equivalent height) -'btp' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 149 ; - } #Steric height 'sh' = { discipline = 192 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index 9483b29c3..f4c9645c4 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -17069,12 +17069,6 @@ parameterCategory = 151 ; parameterNumber = 148 ; } -#Bottom Pressure (equivalent height) -'m' = { - discipline = 192 ; - parameterCategory = 151 ; - parameterNumber = 149 ; - } #Steric height 'm' = { discipline = 192 ; From 506b82de44b93303dc74d8e0ea583b3ac83ca97b Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Mar 2023 13:31:09 +0000 Subject: [PATCH 207/212] ECC-1561: GRIB2: Update some legacy ocean parameters (cfName for 262133) --- definitions/grib2/cfName.def | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/definitions/grib2/cfName.def b/definitions/grib2/cfName.def index 7055d11f9..4a3e6b60b 100644 --- a/definitions/grib2/cfName.def +++ b/definitions/grib2/cfName.def @@ -190,6 +190,18 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Heat flux correction +'heat_flux_correction' = { + discipline = 10 ; + parameterCategory = 3 ; + parameterNumber = 18 ; + typeOfFirstFixedSurface = 160 ; + typeOfSecondFixedSurface = 255 ; + scaledValueOfFirstFixedSurface = 0 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = missing() ; + scaleFactorOfSecondFixedSurface = missing() ; + } #Eastward sea water velocity 'eastward_sea_water_velocity' = { discipline = 10 ; From c586312a3955b60f0111bf00548d2abe3a443a4c Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Mar 2023 13:59:59 +0000 Subject: [PATCH 208/212] ECC-1558: levtypes --- definitions/grib2/marsLevtypeConcept.def | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/definitions/grib2/marsLevtypeConcept.def b/definitions/grib2/marsLevtypeConcept.def index dd5ed5945..e72a2d701 100644 --- a/definitions/grib2/marsLevtypeConcept.def +++ b/definitions/grib2/marsLevtypeConcept.def @@ -36,6 +36,8 @@ scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255;} 'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=160;} 'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=9;} +'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=20; + scaledValueOfFirstFixedSurface=0; scaleFactorOfFirstFixedSurface=0;} 'sfc' = {typeOfFirstFixedSurface=162; typeOfSecondFixedSurface=255;} 'sfc' = {typeOfFirstFixedSurface=166; typeOfSecondFixedSurface=255;} 'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=255;} @@ -49,7 +51,11 @@ 'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255; discipline=1;} 'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=255;} 'o2d' = {typeOfFirstFixedSurface=176; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=160; + scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=0;} 'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176;} 'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176; discipline=1;} 'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=176;} 'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;} + From 73f0ff3993475d0ebcbb80476dab34b33c2081e2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 29 Mar 2023 16:04:20 +0000 Subject: [PATCH 209/212] Updated URL --- src/grib_accessor_class_concept.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grib_accessor_class_concept.cc b/src/grib_accessor_class_concept.cc index 184bca963..f89072177 100644 --- a/src/grib_accessor_class_concept.cc +++ b/src/grib_accessor_class_concept.cc @@ -412,11 +412,11 @@ static int grib_concept_apply(grib_accessor* a, const char* name) } if (strcmp(act->name, "paramId") == 0 && string_to_long(name, &dummy) == GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, - "Please check the Parameter Database 'https://apps.ecmwf.int/codes/grib/param-db/?id=%s'", name); + "Please check the Parameter Database 'https://codes.ecmwf.int/grib/param-db/?id=%s'", name); } if (strcmp(act->name, "shortName") == 0) { grib_context_log(h->context, GRIB_LOG_ERROR, - "Please check the Parameter Database 'https://apps.ecmwf.int/codes/grib/param-db/'"); + "Please check the Parameter Database 'https://codes.ecmwf.int/grib/param-db/'"); } /* Create a list of all possible values for this concept and sort it */ From 9da0028a3d758436d0ae6bd815b13f5ee3b65add Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 30 Mar 2023 16:11:41 +0100 Subject: [PATCH 210/212] ECC-1562: Segmentation fault: Invalid orderby directive --- src/grib_fieldset.cc | 7 ++++++- tests/grib_ls.sh | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/grib_fieldset.cc b/src/grib_fieldset.cc index 5c104405e..0c7ba5652 100644 --- a/src/grib_fieldset.cc +++ b/src/grib_fieldset.cc @@ -373,6 +373,7 @@ static grib_fieldset* grib_fieldset_create_from_keys(grib_context* c, const char else { type = default_type; } + //if (type==0) type = default_type; *err = grib_fieldset_new_column(set, i, key, type); grib_context_free(c, key); } @@ -925,6 +926,10 @@ static int grib_fieldset_set_order_by(grib_fieldset* set, grib_order_by* ob) if (*p == ':') *p = 0; for (i = 0; i < set->columns_size; i++) { + if (!set->columns[i].name) { //ECC-1562 + grib_context_log(set->context, GRIB_LOG_ERROR, "grib_fieldset_set_order_by: Invalid type for key=%s", next->key); + return GRIB_INVALID_TYPE; + } if (!grib_inline_strcmp(next->key, set->columns[i].name)) { next->idkey = i; break; @@ -933,7 +938,7 @@ static int grib_fieldset_set_order_by(grib_fieldset* set, grib_order_by* ob) if (next->idkey == -1) { grib_context_log(set->context, GRIB_LOG_ERROR, "grib_fieldset_set_order_by: " - "Unable to apply the order by. Key missing from the fieldset.\n"); + "Unable to apply the order by. Key missing from the fieldset."); return GRIB_MISSING_KEY; } next = next->next; diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index 0bad1f026..f5702addc 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -181,5 +181,13 @@ for cval in -1 0 xx; do done +# ECC-1562: Segmentation fault: Invalid orderby directive +set +e +${tools_dir}/grib_ls -B'shortName: asc' tigge_af_ecmwf.grib2 > $tempText +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid type for key=shortName" $tempText + # Clean up rm -f $temp1 $temp2 $tempText $tempLog From efaea1c3a2bd2c7e17ccd8b5fb375b6f412889af Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 30 Mar 2023 15:31:39 +0000 Subject: [PATCH 211/212] ECC-1562: Fix test --- tests/grib_ls.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index f5702addc..0c19230bc 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -183,7 +183,7 @@ done # ECC-1562: Segmentation fault: Invalid orderby directive set +e -${tools_dir}/grib_ls -B'shortName: asc' tigge_af_ecmwf.grib2 > $tempText +${tools_dir}/grib_ls -B'shortName: asc' tigge_af_ecmwf.grib2 > $tempText 2>&1 status=$? set -e [ $status -ne 0 ] From 5c3840ccbfbfbe73bb5eb1aba855d244fb7c782d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 30 Mar 2023 17:09:24 +0100 Subject: [PATCH 212/212] Formatting --- src/grib_accessor_class_data_ccsds_packing.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_accessor_class_data_ccsds_packing.cc b/src/grib_accessor_class_data_ccsds_packing.cc index bbf75696b..a96625e3d 100644 --- a/src/grib_accessor_class_data_ccsds_packing.cc +++ b/src/grib_accessor_class_data_ccsds_packing.cc @@ -296,7 +296,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } else { if (bits_per_value == 0) { // ECC-1202: A non-constant field with bitsPerValue==0! - bits_per_value = 24; // Set sane value + bits_per_value = 24; //Set sane value } }