diff --git a/src/eccodes.h b/src/eccodes.h index 4626593bd..53645727d 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -1237,7 +1237,7 @@ int codes_points_get_values(codes_handle* h, codes_points* points, double* val); #define CODES_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC GRIB_UTIL_GRID_SPEC_POLAR_STEREOGRAPHIC #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_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX #define CODES_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE GRIB_UTIL_PACKING_TYPE_SPECTRAL_SIMPLE diff --git a/src/grib_api.h b/src/grib_api.h index dd9b6f25f..8e5b1d83c 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -1399,6 +1399,7 @@ int grib_points_get_values(grib_handle* h, grib_points* points, double* val); #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 typedef struct grib_util_grid_spec { diff --git a/src/grib_util.c b/src/grib_util.c index abb0f2fa7..7f72517f6 100644 --- a/src/grib_util.c +++ b/src/grib_util.c @@ -749,6 +749,9 @@ static const char* get_grid_type_name(const int spec_grid_type) if (spec_grid_type == GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL) return "lambert"; + if (spec_grid_type == GRIB_UTIL_GRID_SPEC_UNSTRUCTURED) + return "unstructured_grid"; + return NULL; } @@ -1067,10 +1070,11 @@ grib_handle* grib_util_set_spec2(grib_handle* h, } break; case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA: + case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: if (editionNumber==1) { /* This grid type is not available in edition 1 */ if (h->context->debug==-1) - fprintf(stderr,"ECCODES DEBUG grib_util: lambert_azimuthal_equal_area specified " - "but input is GRIB1. Output must be a higher edition!\n"); + fprintf(stderr,"ECCODES DEBUG grib_util: '%s' specified " + "but input is GRIB1. Output must be a higher edition!\n", grid_type); convertEditionEarlier=1; } sprintf(name, "GRIB%ld", editionNumber); @@ -1217,6 +1221,13 @@ grib_handle* grib_util_set_spec2(grib_handle* h, COPY_SPEC_LONG(centralLongitudeInMicrodegrees); */ + break; + case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: + COPY_SPEC_LONG (bitmapPresent); + if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); + /* + * TODO: Other keys + */ break; case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL: COPY_SPEC_LONG (bitmapPresent);